![]() |
Tracking Downloads, Outgoing Clicks etc - Event Date: 28 Aug 2006 - 29 Aug 2006 |
Post Reply
|
| Author | |
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1389 |
Post Options
Quote Reply
Calendar Event: Tracking Downloads, Outgoing Clicks etcPosted: 28 Aug 2006 at 10:05am |
|
If you are using the WhosOn Gateway to track visitors via the embedded page tags, you can still use WhosOn to track downloads (PDFs, EXEs etc) and outgoing clicks. In fact any page event can be tracked.
This is done using a version of the WhosOn Tracking Code, which sends an event back to the WhosOn server without displaying any image. It can be included on pages along with the normal tracking code. Download the script here: http://www.whoson.com/scripts/whoson_call.js Save it to the root of your site. Include it on your page like this: <script language="javascript" src="/whoson_call.js"></script> Then simply call it on the 'onclick' event of any page element, for example: <A href="myfile.exe" onclick="javascript:writeWhosOn('gateway','domain','myfile.exe');">Click To Download</a> Replace 'gateway' with the name of your Whoson Gateway (email us if you dont know your Gateway name) and 'domain' with the domain name of the site being monitored in WhosOn. The WhosOn gateway that you are using will be shown in the existing tracking code - look at the 'var sWOGateway = ' line. The last parameter is the filename/pagename or event name that you want to appear in WhosOn when the element is tracked. For Example: <A href="myfile.exe" onclick="javascript:writeWhosOn('gateway21.whoson.com','www.mysite.com','myfile.exe');">Click To Download</a> For some more examples of tracking page events, see: http://www.whoson.com/test.htm |
|
![]() |
|
Patzer
New User
Joined: 29 Aug 2006 Posts: 1 |
Post Options
Quote Reply
Posted: 29 Aug 2006 at 12:50am |
|
That looks great for tracking clicks on download link and leaving the site, however when it comes to Adsense you may not alter the code in any way, that includes adding Javascript to the Adsense code itself. To Track Adsense via Google Analytics I include a script that I found on another site at the end of my page. How could I alter this script to have Whos on track the same activity. Thanks.
-Mike
This is the script I use to have analytics track Adsense:
<script type="text/javascript">
function adsense_click() {
if(window.status.indexOf('go to') == 0) {
urchinTracker ('/AdSenseClick');
}
}
var elements;
if(document.getElementsByTagName) {
elements = document.body.getElementsByTagName("IFRAME");
} else if (document.body.all) {
elements = document.body.all.tags("IFRAME");
} else {
elements = Array();
}
for(var i = 0; i < elements.length; i++) {
if(elements[i].src.indexOf('googlesyndication.com') > -1) {
elements[i].onfocus = adsense_click;
}
}
</script>
|
|
![]() |
|
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1389 |
Post Options
Quote Reply
Posted: 29 Aug 2006 at 11:09am |
|
Hi,
In the Adsense code you just need to add a call to the write_WhosOn function.
Under the line:
urchinTracker('/AdSenseClick');
Add:
write_WhosOn('{gateway}','{yourdomain.com}','AdSenseClick');
Steve
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |