DotNetNuke Video Tutorials
Oct 14

Written by: Aderson Oliveira
Thursday, October 14, 2010 

9 min : 25 sec

Complexity Level: 3 - I know what I'm doing! This video will show how to add Google Analytics Event Tracking to links in DotNetNuke.



14 comment(s) so far...

DNNHero Premium Membership


Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Thanks... This was hugely helpful!

By browe on   Thursday, October 14, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Great that you liked it Browe!

By Aderson on   Thursday, October 14, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Aderson, extremely helpful video tutorial. I'm trying to set up my first test of event tracking on our DNN site, by tracking clicks on a particular image. Is there any way you recommend to test that the event tracking is working properly aside from waiting 24 hours for data to show up?

BTW, this is the code I currently have, if you see anything that jumps out as incorrect, I would appreciate your insight.




By Eric Polatty on   Thursday, October 28, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Eric,

Unfortunately you will have to wait. I'm know it is a pain, but there is not much to be done. I had to go through a bit of trial and error when I was trying to set this up for the first time. So I had to wait the next day to see the results.

One way that you can at least see if the javascript event is running fine is to try it in IE (by clicking the link) and see if you get any warning message from it. Usually the warning comes as a yellow icon in the bottom left corner of your browsers status bar in case there is a problem. If there is no problem then no warning icon will show up.

BTW, you have pasted an html fragment and we are not able to see it, but I have "viewed the page source" and your code seems fine.

Cheers,
-Aderson

By Aderson on   Thursday, October 28, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Thanks so much Aderson. Also one other thing that jumped out at me - the code you are using seems different than the official Event Tracking guide on code.google.com. (code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html)

This is the sample code they had pasted.
Play

What is the nature of the difference?

Thanks again

Eric

By Eric on   Thursday, October 28, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Looks like my example of the event tracking code on code.google.com did not go through let me try again:

By Eric on   Thursday, October 28, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Eric,

The code that I have placed is the code compatible with the "Google Analytics" feature that come with DNN.

Google has been evolving that code over time and if you try that very new code with the "Google Analytics" feature already in DNN they will not work together. Not sure if I was clean enough but here is in a different way:

1 - If you are using "Google Analytics" feature in DNN (Admin/Google Analytics) then you should use the code that I show;

2 - But if you are using the script given to you directly by Google for your analytics, then you can use that version of the track code that you saw at that Google page;

I hope this helps and doesn't confuse you.

Cheers,
-Aderson

By Aderson on   Thursday, October 28, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Addison,

No, that makes perfect sense. It is a shame that Google doesn't document these kinds of differences clearer in their own help files. Without your insight I would have been toiling on this for much longer.

By Eric on   Monday, November 1, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

You right Eric. Good this you were able to get it and meke it work for you.

BTW - www.MyNameIsNotAnderson.com nor Addison :)

By Aderson on   Monday, November 1, 2010

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Is there a way to add Event Tracking to a video (loads, plays, pauses, etc.)? I am using CodingStaff.VideoPlayer and embedded YouTube code.

By Ben on   Wednesday, February 16, 2011

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Ben, as long as you can attach a javascript code to the player controls, then there would be a way, but I don't think you will be able to do that with YouTube videos

By Aderson on   Wednesday, February 16, 2011

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

For anyone who wants to use the event tracking code, it is:

onclick="pageTracker._trackEvent('Category','Action','Label');"

Aderson, have it as text is much more helpful than in a flash video, especially for copy & pasting.

By Brent on   Tuesday, February 22, 2011

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

I also couldn't get the version included in the video to work:

onclick="pageTracker._trackEvent('Category','Action','Label');"

It threw the error "pageTracker not defined" in the FireBug console.

I used the version included in Google docs and it worked fine.

onclick="_gaq.push(['_trackEvent', 'Category', 'Action', 'Label']);"

By Brent on   Tuesday, February 22, 2011

Re: Adding Google Analytics Event Tracking in DotNetNuke - Video #152

Hi Brent,

Thanks for the feedback!

BTW, in regards to the Google tracking code, there are two versions:

1 - Traditional, which is the way I have explained;

2 - Asynchronous, which is what you have explained;

Here is a bit of explanation from Google:
code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html

Going forward you should definitely try using the version that you have suggested. In case it fails, you can try the traditional.

Cheers!

By Aderson on   Tuesday, February 22, 2011

Do you have a question? Ask on our Forum!

Video Search


Try FREE
30 days money back guaranteed