I am a new blogger and just launched my blog. Here i am starting my first post on event tracking feature in Google analytics. I am sharing this post on how to track the user interaction with social media links like twitter, linkedin and facebook. So after some research, trial and error methods finally got my reports.
What you need?
To start with, install analytics code properly in your website. Check tracking code you have used(traditional or asyn script). Here i have used asynchronous tracking script in my website.
Event tracking basics:
For setting up event tracking the syntax/format of '_trackEvent' method is.
('_trackEvent', category, action, label, value)
Category - specifies the name of the event. It might be a video, pdf, flash or any object.
Action - specifies the action the user does. Either click, play etc..
Label - specify label for the interaction.
Value - specify value for the event. Use integer values for "value" parameter.
Category and Action are required parameters to be used. Label and Value fields are optional and you can use it if you need.
How to track?
So to track the clicks/visits to social media profiles(twitter and facebook) add the following code:
<a href="http://twitter.com/xyz" onClick="_gaq.push('_trackEvent', 'twitter', 'click');>
Here I have added only the necessary fields here "Category" (twitter) and "Action" (click).
You're done. Wait for results to be shown in Content report > Event tracking.
What you need?
To start with, install analytics code properly in your website. Check tracking code you have used(traditional or asyn script). Here i have used asynchronous tracking script in my website.
Event tracking basics:
For setting up event tracking the syntax/format of '_trackEvent' method is.
('_trackEvent', category, action, label, value)
Category - specifies the name of the event. It might be a video, pdf, flash or any object.
Action - specifies the action the user does. Either click, play etc..
Label - specify label for the interaction.
Value - specify value for the event. Use integer values for "value" parameter.
Category and Action are required parameters to be used. Label and Value fields are optional and you can use it if you need.
How to track?
So to track the clicks/visits to social media profiles(twitter and facebook) add the following code:
<a href="http://twitter.com/xyz" onClick="_gaq.push('_trackEvent', 'twitter', 'click');>
Here I have added only the necessary fields here "Category" (twitter) and "Action" (click).
You're done. Wait for results to be shown in Content report > Event tracking.
No comments:
Post a Comment