Rudi Shumpert : Code By Numbers
21Jul/102

Share This Page – On Your Terms!

Build your own "Share this page" feature!

Not too long ago I added one of the "Share this page" scripts, AddToAny, to our web site.  This seemed like it was going to work fine but this approach had 3 major drawbacks.

  1. Most of these services require you to link to their JavaScript file on their servers.  Sure this is fairly reliable but I am not a fan of this approach.
  2. Limited tracking / analytic capabilities.
  3. Cookies you can not control.

The first two issues are not huge issues, but while we were testing the site, we noticed that the scripts were adding a few of their own cookies to our users.  I understand why this is, but I did not like it and the feature was pulled.  So I tested out another one, Share This, and it did the same thing. Not only do they add cookies to your users, but they are also tracking usage of their tool on your site.  I don't blame them for this, after all they are providing this as a free service but I still do not like it.

After looking at the scripts for a while I decided that it could not be that difficult to write my own "Share this page" feature.

My goal was to create a widget to let users share the current web page without the limitations listed above.  With just a wee bit of research I found the methods needed to be able to share a page via email, Twitter, Facebook, and LinkedIn. And then track the usage of data in Omniture SiteCatalyst.

<ul>
  <li><A onClick="jsFunctionToRecordClick('Email');" HREF="mailto:?subject=#variables.emailSubject#&body=#variables.emailMessage#">Email </a></li>
  <li><a onClick="jsFunctionToRecordClick('Twitter');" href="http://twitter.com/home?status=#variables.twitterLink#" target="_blank">Twitter </a></li>
  <li><a onClick="jsFunctionToRecordClick('LinkedIn');" href="http://www.linkedin.com/shareArticle?mini=true&url=www.rudishumpert.com&title=AmazingArticle&summary=This is the best ever&source=Rudi"  target="_blank">LinkedIn </a></li>
  <li><a onClick="jsFunctionToRecordClick('Facebook');" href="http://www.facebook.com/share.php?src=bm&u=#variables.currentPage#&t=#variables.twitterLink#&v=3" target="_blank">Facebook </a></li>
</ul>

Sample links without the tracking added:

And then the JS Function: Note the JS function is specific to Omniture tracking but this could be leverage for any analytic solution with some minor tweaking.

			function jsFunctionToRecordClick(category){
				var s = s_gi(s_account);
				s.linkTrackVars="events,eVarN,propN,propN";
				s.linkTrackEvents="eventN";
				s.events="eventN";
				s.eVarN=''+category+'';
				s.propN=''+category+'';
				s.propN=''+category+' | '+s.pageName+'';
				s.tl();
				s.events="";
				s.linkTrackEvents="";
				s.linkTrackVars="";
				s.eVarN='';
				s.propN='';
				s.propN='';
			}

The feature is added to the page using a jQuery menu script that creates the same mouse-over drop down effect that the free scripts use, but you can use any sort of presentation approach that fits your web site's style.

And that is it.  You know have your own custom share this web page feature that your can style however you like and maintain complete control over what cookies are used on your site and what level of tracking you would like to get out of the widget.

4Feb/100

ColdFusion User Group Presentations

At the February 2010 Atlanta ColdFusion User Group (ACFUG) meeting  &  at the ColdFusion Meetup I gave a presentation on working with Omniture & ColdFusion.   I based the presentation on a blog post I wrote last September.

As promised here are the presentation materials:

Bonus Resources:

In addition to numerous articles I have posted here on my blog, below are some great resources related to Omniture and web analytics in general.  If you have questions or comments, please leave them below.

Omniture Resources:

Web Analytics Resources:

Books:

-Rudi

26Jan/105

Tracking Page Load Times

One of my favorite things about ColdFusion is the level of detail you can get from the debugging information.  The ColdFusion server will provide upon request and the right permissions: variable scopes, sql query information,  server information, and execution / load times.  This is very useful information to have while coding and is invaluable when you are trying to optimize the speed and performance of the site. However, is it hard to get good benchmark for this data over time from the perspective of your end users.

Earlier this week, I set out to see if there was a way I could get access to the page load data and send it along to Omniture so that I could first get a benchmark of what the performance of the web site was over time, and second be able to tell if changes we made to the site had any impact on performance.

My first attempt in accomplishing my goal was to try and access the same Java object that the debugging code used to get the execution times.  I thought, well I see it in the output on the screen, it should be easy enough to grab that data element and pass it along.

Read the rest of this entry »

11Nov/090

Form Abandonment

NOTE: The code samples below are merely a proof of concept. This solution is not actively in place in any production environmetn that I am involved with.

I was talking to a fellow ColdFusion developer about a web site he was working on, specifically a registration form, and what were some of the best practices with form length and such that would facilitate users filling out the form and submitting.   This is a common issue with web sites that will not be going away anytime soon.  In fact the questions he had are the same ones I have seen in dozens of blog posts trying to figure this out.

  • How many questions to put on a form?
  • What type of questions work the best?
  • What question(s) scared off a user and kept them from completing the form?

I know that there are a few "Form Abandonment" plug-ins out there for Omniture and the likes, but from what I've seen the data you get is somewhat limited.   If your form has 20 elements on it and the plug-in only lets you know what the last element with focus was, you have to really think about the validity of that data.  How do you know for sure that the user filled out the elements in order?  Did the developer of the form set the tab index correctly?  Did the user glance at the form, click somewhere near the bottom and then bail?  Did the user fill out half the form the shut down the browser?

Read the rest of this entry »

6Oct/090

Bing! You have inflated traffic numbers!

Our #1 Fan!  The past couple of months we noticed a very odd trend the the geo-location / city data that was being saved in Omniture.  The great metropolis of Redmond, Washington was now the number 1 city of origin of our web visitors.  And this was not a small lead, they were the number 1 city by more than double the traffic from the number 2 spot.

Trying to find an explanation for all this, I checked the twitter-verse and did a little digging online, but did not have a chance to really dive into the issue until yesterday. Read the rest of this entry »

Get Adobe Flash playerPlugin by wpburn.com wordpress themes