In a pre­vi­ous post, I described cus­tom link track­ing, its var­i­ous uses, and imple­men­ta­tion tech­niques. Link track­ing is awe­some because it opens up a wide vari­ety of data points and user expe­ri­ence aspects that can’t always be tracked on page loads. But every­thing hinges on the s.tl() func­tion, which is part of the Site­Cat­a­lyst JavaScript code base. What hap­pens if your users don’t have JavaScript enabled? This is very rare among desk­top web users, but with the mobile web only gain­ing momen­tum, it’s an impor­tant ques­tion. How can we mea­sure user actions if we don’t have the s.tl() func­tion avail­able to us?

If mobile web mea­sure­ment is impor­tant to your online busi­ness ini­tia­tives, then you’ve prob­a­bly already seen the Mobile Device Report­ing guide. This doc­u­ment shows how you can use a hard-coded (although per­haps dynam­i­cally gen­er­ated server-side) image request like the one shown below to pass page view data into Site­Cat­a­lyst even when the user doesn’t have JavaScript available.

<img src="http://metrics.yoursite.com/b/ss/gainesweb/5/54781023478?gn=Mobile%20Home&g=http%3A%2F%2Fm.mysite.com%2Findex.html&ch=Home&c1=Mobile%20Traffic&ev=event1&v0=mobile_campaign" />

This would count a page view for “Mobile Home” (gn= is the same as page­Name=; mobile imple­men­ta­tions allow you to sub­sti­tute shorter para­me­ter names), and a click-through for the “mobile_campaign” track­ing code. You’ll do some­thing very sim­i­lar to imple­ment link track­ing on mobile sites, but you will instead use an anchor tag, where the href (des­ti­na­tion URL) prop­erty is the Omni­ture image URL. Here’s an exam­ple, with the ele­ments just men­tioned in red:

<a href="http://metrics.yoursite.com/b/ss/gainesweb/5.4/REDIR/?url=http%3A%2F%2Fm.mysite.com%2Fdestination_page.html&ev=event2&v5=link%20click&pe=lnk_o&pev1=D=url&pev2=mobile%20link%20click" />

There are a few impor­tant dif­fer­ences between this exam­ple and the one given above. As explained, we’re using an anchor tag rather than an image tag. There is a /REDIR/ ele­ment at a spe­cific point in the path. There is a url= query para­me­ter, the value of which is the des­ti­na­tion URL for the page that we want the user to end up view­ing after click­ing the link. And all of the stan­dard link track­ing para­me­ters (pe=, pev1=, and pev2) are present. Note that we’re using one of the coolest fea­tures of Site­Cat­a­lyst mobile measurement—“dynamic” vari­ables (indi­cated by “=D=url”)—to set the pev1= para­me­ter equal to the page URL. This can save tons of char­ac­ters in your request URL!

This will send all of the data in this image request to Site­Cat­a­lyst, and then it will take the user to the URL given in the url= para­me­ter. As shown above, for exam­ple, an instance of event2 will be counted. The value “mobile link click” will show up in the Cus­tom Links report. Had I wanted to do so, I could’ve set props, eVars, or the prod­ucts vari­able. It cap­tures every­thing that you want to mea­sure regard­ing the user action, just like a nor­mal, JavaScript-based request. It then redi­rects the user to the URL given in the url= para­me­ter, so that to the end user, it behaves just like a nor­mal link.

You’ll want to set the link track­ing para­me­ters cor­rectly, so here is a table show­ing what they represent:

Para­me­ter Def­i­n­i­tion Possible/example val­ues
pe= Type of user action lnk_o for cus­tom links/general
lnk_d for file down­loads
lnk_e for exit links
pev1= Des­ti­na­tion URL Any des­ti­na­tion URL
http%3A//m.mysite.com/some_url.html
http%3A//mobile.yoursite.co.uk
pev2= Link Friendly Name (dis­plays in Cus­tom Links report) Cus­tom Value
My Link

A few final notes:

  1. Make sure to put the url= para­me­ter first in a mobile link track­ing tag. This ensures that the user is cor­rectly redi­rected even if the mobile device trun­cates the request of the request URL.
  2. We don’t need a ran­dom num­ber in the link track­ing request, since we aren’t con­cerned about the link get­ting cached (as we typ­i­cally are when receiv­ing an image).
  3. Using 5.4 in the bea­con ensures that the vis­i­tor ID method order stays con­sis­tent if using /5/ for the stan­dard page view bea­cons. (See the Mobile Device Report­ing guide for more infor­ma­tion on this.)
  4. The pev2= para­me­ter isn’t strictly nec­es­sary. It may be omit­ted in these requests; the pev1= value (the link URL) will dis­play in reports instead.
  5. Using first-party cook­ies is strongly rec­om­mended for mobile imple­men­ta­tions and will make the link URLs much friend­lier; I used them in the exam­ples above (“met​rics​.your​site​.com”). If you are not using first-party cook­ies, sim­ply replace “met​rics​.your​site​.com” in the exam­ples above with “[your namespace].[112 or 122].2o7.net.”

There you have it. Make sure you refer back to my post on link track­ing if you have any ques­tions about the con­cept or value of what I’ve described here. One final tip: As you may have noticed in the exam­ples in this post, I URL encoded every­thing (e.g., %20 instead of a space). Make sure to do this when imple­ment­ing mobile web mea­sure­ment in Site­Cat­a­lyst; it will ensure that your data looks exactly the way you want it to look!

Ques­tions? Con­cerns? Applause? Please feel free to con­tact me by leav­ing a com­ment on this post, or via Twit­ter or Friend­Feed. I’d love to hear from you!

  • S Mar­shall

    Where can I get the Mobile Device Report­ing guide you men­tion? I searched for it on Omni​ture​.com, but did not find it — at least not by that name. thanks.

    • http://blogs.omniture.com/author/bgaines Ben Gaines

      Sorry about that. From the Site­Cat­a­lyst home page, it’s avail­able by click­ing the User Man­u­als link. Or, you can get it my going to Help > Help Home, then choos­ing Sup­port­ing Docs > User Man­u­als from the left nav menu. Let me know if that doesn’t lead you to the guide.

  • http://www.danskebank.dk Jan Lund

    Hi. It did’nt lead me to the guide.… Could you pro­vide a direct link? Thanks

    • http://blogs.omniture.com/author/bgaines Ben Gaines

      Hi Jan. Unfor­tu­nately, I can­not pro­vide a direct link, as you must be logged into Site­Cat­a­lyst with an active ses­sion in order to down­load the user guide. Were you unable to find it at Help > Help Home, then Sup­port­ing Docs > Manuals?

  • lg

    I have a link on a Face­book cus­tom tab on which I have placed a hard coded image request for link track­ing. The track­ing is work­ing fine but the redi­rect is not work­ing. Not sure what I am miss­ing. This is how i have the image request struc­tured (with generic name space and rsid):

    href=“http://namespace.112.207.net/b/ss/reportsuiteid/5/REDIR/?url=http%3A%2F%2Fwww%2Eyahoo%2Ecom&pe=lnk_o&pev1=http%3A%2F%2Fwww%2Etest%2Ecom&pev2=testing&”

    Can you tell me what is miss­ing or incor­rect in the above href?

    • http://blogs.omniture.com/author/bgaines Ben Gaines

      It is almost perfect—the only thing you need to do is change the /5/ in that URL to a /4/ and it will work.

      (A shout-out to my col­league, Jeremy Ander­son, for catch­ing that mis­take after I missed it.)

  • John Mooney

    Ben — I think the Test and Tar­get team is show/hiding the link to User Man­u­als on the SC home page. I saw it once in one browser recently but not in another. If I view HTML source on the SC HP, I can find the text User Man­u­als and it’s link, but, it isn’t vis­i­ble on my logged in HP. I would ask that this always be shown.

    It was chal­leng­ing to find this PDF. I even­tu­ally found one named “Mobile Track­ing Imple­men­ta­tion Guide” — is this the one you referred to as Mobile Device Report­ing Guide, or, is there another doc­u­ment about set­ting up mobile tracking.

    • http://blogs.omniture.com/author/bgaines Ben Gaines

      Yes, that’s the one. I think they’ve changed the title of the PDF since I did this post. I’ll update the post to reflect the new title.

      Within Site­Cat­a­lyst, I nor­mally tell peo­ple to go to Help > Doc­u­men­ta­tion to get the user manuals/PDFs. Test&Target has a slightly dif­fer­ent help sys­tem (“web help”) which pro­vides a tree-like struc­ture to doc­u­men­ta­tion and gives every­thing in search­able HTML. I don’t believe the T&T user man­u­als are avail­able from within Site­Cat­a­lyst (or by going to Help > Doc­u­men­ta­tion), but they should always be avail­able within the T&T UI. I hope that helps… please let me know if I’m mis­un­der­stand­ing the question!

  • http://www.optibeat.com Steve

    Thanks for this — I actu­ally think there might be a typo in the mobile imple­men­ta­tion doc as it uses /4/ as an image type instead of /5.4/ for the on-click event track­ing exam­ple (page 7). Maybe it doesn’t make a dif­fer­ence but it was con­fus­ing until I read this article.