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
-
Weird Math in GA Ecommerce Tracking
Hi everybody. I've recently discovered that I have a problem with the ecommerce tracking on a client's website. The client sells concert tickets at an average price of $10 per ticket. The custom ecommerce platform they use is kind of unusual; the same product often has different SKUs, but not always. This isn't associated with different seats, etc. In fact, I don't yet know why they've set it up that way. The problem that I'm facing is this: the data in Analytics is calculating the "average price" of a SKU item as the total price. If, for example, the actual average price for a SKU item is $10 and four of those SKU items were sold, Analytics will tell me the average price is $40. This means that the total revenue for that SKU shows up as $40 x 4 = $160. Needless to say, this is enormously skewing the data. Here's a screenshot. Note, it's the same product: http://screencast.com/t/JyLQkb3jzz6s The total revenue for ticket sales is way off because of this, and I'm not sure if it's a problem with the ecommerce tracking code in Analytics, or something that the ecomm platform is doing. Have any of you experienced anything like this, and if so is it a fix in Analytics? Thank you!
Reporting & Analytics | | newwhy0 -
What Parameters and Rules i set to track all types of click?
Hello Expert, If i want to track all types of clicks either link, button, drop down etc for my website then what parameters i add in "Event Tracking parameters" and what will be firing rules. I already have universal analytic and google tag manager. Track Type as even i selected in google tag manager now please tell me 1) what i add in category, Action, label? 2) what should be the rule. I will be really thankful to you if you give cut to cut answer instead of sharing post.
Reporting & Analytics | | bkmitesh0 -
How to track affiliate ads on Google analytics
Hi Im new google analytics user, I would like to track affiliates ads (banner flow -javascript) on my website. How to set up goals to track affiliate ads? thanks.
Reporting & Analytics | | info_tipovanie-stavkovanie.com0 -
How do I manually add transactions to Google Analytics
We are seeing Google Analytic's drop transaction on our site so therefore all the figures are skewed. Is there a way I can manually add transactions to GA to cover the missing one?
Reporting & Analytics | | Towelsrus0 -
Google Analytics tracking code for completely new website
Hello! I use Google Analytics to monitor our company's websites. In the coming weeks we will roll out a brand new website for one of our brands to replace its current site. The domain name will remain the same. My question is, should I use the same tracking code that's been used on the existing site for the new site, or is there a benefit to creating a new tracking code? Thanks in advance!
Reporting & Analytics | | SmileMoreSEO
Erik0 -
What's the final word on Image Search tracking in Google Analytics?
Sorry if this has been answered but I can't seem to get a straight answer to my questions by searching around. How is traffic referred by Google Images counted in Google Analytics? I know it used to be referral traffic from google.com/imgres. A lot of things I have read say that it should all be under google/organic now, but my site still gets referral traffic from google.com/imgres, so that can't be. However I also get traffic as google/organic that I am pretty sure is from image search, because we don't rank for the keyword normally, but we do for image search. What's the deal? How is traffic from an embedded image in a regular result page counted? How can I segment my image search traffic better? It would be great to see image search traffic as it's own medium. I found a script here -- http://jrom.net/google-images-in-google-analytics -- that looks promising, has anyone used it or can recommend another way? I haven't used the GA API very much so I want to make sure the script is kosher and won't screw up my numbers.
Reporting & Analytics | | tact0 -
Conversion tracking
Is there a way in GA to setup tracking of the clicking internal URL that 301's to an affiliate ID? Peter
Reporting & Analytics | | PeterM220 -
Cross Domain Goal Tracking
I am trying to set up conversion tracking on a new website. The traffic will be landing on example.com, but the final step of the transaction takes place on app.example.com. This is the first time I have ever done something like this and Google's documentation does not have a lot of details about how to do this in GA. Does the tracking code need to be installed on example.com and app.example.com? when setting up the goal page does it need to be /landing-page/thank-you or app.example.com/landing-page/thank-you is this well documented in google's help finals and i am just calling it the wrong thing?
Reporting & Analytics | | Simple_Machines0