How do I add event tracking to these buttons?
-
I have two separate events that I would like to track on my site.
[Ask a Question](javascript:__doPostBack('ctl00$MainContent$AskQuestionButton',''))
and
I think I would want to use this-_gaq.push ([‘_trackEvent’,’event category’,’event action’,’event label’, event value]); Is that correct? Where would I place it in the button code?
Would this work?
_gaq.push ([‘_trackEvent’,’AskAQuestion’,’Submitted’,’event label’, event value]);The event doesn't have a label or value. Are those left blank?
-
Yes - that's right.
What you should do is implement it - then click on the link and at the same time check your real time analytics report in GA. They've added a new tab that allows you to see your events in real time. So you should see the event being logged as an active visitor on the site.
-
Do I need the quotes around the gaq push all the way to the end? I am seeing some mixed results when I search for that.
onclick="_gaq.push ([‘_trackEvent’,’AskaQuestion’,’Submitted’]); ">
-
Sorry Niners52
I'm just saying to use the apostrophe key on your keyboard to type the apostrophes. Otherwise you might get an odd character like the second apostrophe which looks like a proper apostrophe - but isn't - and that will throw up an error.
Hope that makes sense.
-
My apostrophes look like the second one how do I get them to look like the first?
-
Be careful if you're copying and pasting from here into your code - and ensure that the apostrophe's look like this (') instead of this (‘).
-
I'll try this. Thank You very much!
-
Hi
You need to add an onclick event...
[Ask a Question](javascript:__doPostBack('ctl00$MainContent$AskQuestionButton',''))
and
but replace 'event action', 'event label' and 'event value' with values you can understand like 'top quote button', 'homepage' etc.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Do Lot of Tracking via Tag manager Increase Bounce Rate?
Hello Expert, I am doing lots of tracking for my ecommerce site but I am not sure reason for increase in bounce rate as my traffic also increase but I want to make sure that my tracking not affecting my bounce rate. I do tracking via page views, events, custom html, etc so for all the applicable tags Non-Interaction Hit - I set "True" so I am right here? Thanks!
Reporting & Analytics | | dsouzac0 -
Goal Tracking In Analytics On Separate Ordering Website
I have a question for any Google Analytics wizards out there. We have two clients that have a similar complication when it comes to tracking goal conversions in Analytics. Basically, all the conversion actions we want to track occur on a separate website; either an iframe embedded on the page or through an entirely different ordering website. Trick is, Analytics sees the source for all these conversions as referrals from the main site. We'd like to get visibility back to the original source/medium that brought visitors to the site before they converted. Anyone have a suggestion for making that happen?
Reporting & Analytics | | fivefifty0 -
How can you add a rel canonical tag if you haven't created the wrong pages?
For one of our white paper campaigns we are getting multiple URL's some how but we only have one version of the page. So do I put the rel canonical tag on that one single page? Will that fix the other url's from being indexed? I'm assuming people are typing in the urls with underscores and capital or non-capital letters and it's showing up that way in analytics. Thanks!
Reporting & Analytics | | Sika220 -
Cross Domain Tracking in GA (without cross domain links)
Hi everyone, Been doing some research about cross-domain tracking in Google Analytics (preferably Universal Analytics where documentation is a bit spare). All of the tutorials focus on the auto-linking and ensuring links to the other site are taken care of. I'm considering a site that may not cross-link like that at all (or it may, but won't be the main avenue). A good example is: www.gap.com
Reporting & Analytics | | ketanmv
www.bananarepublic.com
www.oldnavy.com Now, they do link to the other brands in their navigation but let's pretend that they don't necessarily do that. Gap Corporate may want to roll up all these domains into a single reporting profile because customers can clearly visit any of those sites on their own and buy. It would be nice to know that Visitor X bought 2 items from gap.com and 3 from oldnavy.com... and of course, here were their campaigns, etc. From what I am reading, I am not sure this is really possible. It seems that the cross-domain code is really only best for when my main site links to another domain for checkout or something. But in my example, we are definitely not in control of that kind of behavior. Thoughts? Perhaps I need to recommend they go with subdomains only which Universal GA seems to handle quite fine out of the box. Thank you!0 -
Does analytics track an order two times by refresh on the confirmation-page?
Hi there,
Reporting & Analytics | | Webdannmark
I have a quick question. Does Google analytics track an order two times, if the user buys a product, see the confirmation page and then click refresh/click or back and forward again?
The order/tracking data must be the same, but i guess the tracking code runs for every refresh and therefore tracks the order two times in Analytics or does analytics know that it is the same order? Someone that can clearify this?Thanks! Regards
Kasper0 -
Google analytics is not tracking well
Hey, There is something not working in our GA account, its shows too many visits per day, when look where this traffic comes from, the majority comes from (not set). Please find attached. Really appreciate help! Thank you! BvmAKtO
Reporting & Analytics | | Comunicare0 -
Ga event tracking and GAC code placement
Just relaunched website and since then specific event tracking has zeroed. I copied event tracking directly from old site so it should work. Overall analytics are fine. Only variable I can think of is where google analytics code is placed. Does GAC code need to be on HTML header or at end of body specifically for event tracking to work? Example: Steripen.com/freedom/... When user clicks "REI" icon, this tracks an event that a user clicked on one of our"retailer links." Any feedback is greatly appreciated.
Reporting & Analytics | | Timmmmy0 -
Is there a way to use Google Analytics event tracking for YouTube embedded videos on my website?
Hello! I am trying to track different types of interaction on the YouTube for videos which are embedded on a website to measure the interaction on these video from my organic traffic. Is there a good way to go about this with the code since these are coming from an iFrame on YouTube? Would appreciate any feedback or help on implementing the event tracking with YouTube videos. Many thanks!
Reporting & Analytics | | CabbageTree0