Google Analytics Between Two URLs
Happy New Year! We made it, and I can’t believe the Jayhawks won the Orange Bowl!
Been working a lot lately trying to pass Google Analytics cookie data between URLs and have now got it figured out. We have to pass the info between URLs because we need a central secure place to process user data. Anyway, for posterity here’s what works:
| _utmLinker that functions with an image link: |
|
<script type=”text/javascript”>
document.write(’<a href=”javascript:__utmLinker
(\’https://www.myurl.com’);”"rel=”nofollow”>
<img src=”images/button.gif” width=”139″
height=”29″ border=”0″ /></a>’);
</script>
<noscript>
<a href=”https://www.myurl.com” “rel=”nofollow”>
<img src=”images/button.gif” width=”139″ height=”29″
border=”0″ /></a>
</noscript> |
| _utmLinker that functions with a text link |
|
<script type=”text/javascript”>
document.write(’<a href=”javascript:__utmLinker
(\’https://www.myurl.com’);”"rel=”nofollow”>Apply Now
</a>’);
</script>
<noscript>
<a href=”https://www.myurl.com”
“rel=”nofollow”>Apply Now</a>
</noscript> |
| Required modification to the GA Tracking Code |
|
<script src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>
</script>
<script type=”text/javascript”>
_uacct=”UA-0000000-0″;
_udn=”none”;
_ulink=1;
urchinTracker();
</script>
<script>
if(typeof(urchinTracker)!=’function’)document.write
(’<sc’+'ript src=”‘+
‘http’+(document.location.protocol==’https:’?
’s://ssl’:'://www’)+
‘.google-analytics.com/urchin.js’+'”></sc’+'ript>’)
</script>
<script>
_uacct = ‘UA-0000000-0′;
urchinTracker(”/0260360448/test”);
</script> |
| Input the information into a hidden field so that a submit function on a form will pass the information off as well: |
|
<form xid=”form” method=”post” onsubmit=”__utmLinkPost(this);”
|
… and that’s how you do that!
This entry was posted
on Friday, January 4th, 2008 at and is filed under Analytics.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.