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
-
Tracking PDF downloads from SERP clicks
For the longest time, our company policy has always been to put PDFs in a secure folder (hence they are not indexed and do not appear in search results). After evaluating this strategy, there has been clamor in recent months to allow Google to index our whitepapers. My question: Once PDFs start appearing in search results, what is the best way to start tracking clicks due to these "downloads"?
Reporting & Analytics | | marshdigitalmarketing0 -
Number of goals larger than the events its bases on - WTF?
Hi all We configured a standard goal in Analytics that is triggered on an event. I have seen cases where the number of triggered events is larger than the goal completions due to limitations to how many times the same goal can be fulfilled within the same session, BUT in this case we got the opposite problem. We got more Goal Completions than we got events that is supposed to trigger the goal. Now also added a screenshot of how the goal is configured. As you can see its just configured to use the Category name of the event. Nothing fancy at all. How can that be possible? Again, more goal completions than events that is suppose to trigger it? Grateful for any help Fredrik AclZDUO
Reporting & Analytics | | Resultify0 -
Does Universal Analytics auto generate events?
Hi Mozzers, I have been noticing for one of my clients that there are thousands of events generating which I never added a code snippet for ga('send', 'event', 'button', 'click', 'nav buttons', 4);. The code I am seeing instead is following the syntax **PDF FILE NAME.**I don't even use Tag Manager. So are these auto generated? Label names of files aren't great though so I still believe that adding that piece of snippet _ga('send', 'event', 'button', 'click', 'nav buttons', 4);_can still bring some added value. Do you think it still does? Thanks!
Reporting & Analytics | | Ideas-Money-Art0 -
Universal Google analytics e-commerce tracking code?
Hi Mozzers, I have never setup a universal google analytics e-commerce tracking code before and my concern is what exactly do I need to add on the cart thank you page? Can someone send me a sample of code I need to be adding? What kind of customization does it require? The more details you can provide the better! Thanks!
Reporting & Analytics | | Ideas-Money-Art0 -
How do I set up goals in analytics to track the sales funnel when several pages of the steps required to checkout have the same url?
I have found this in Google Analytic but it makes no sense to me - is there are better resource which explains how you do this step by step ( or a good video perhaps?) Identical URLs Across Multiple Steps In some situations, the URL does not change across a sequence of activity. For example, a sign-up process might have the following URL path: Step 1 (Sign Up): www.example.com/sign_up.cgi Step 2 (Accept Agreement): www.example.com/sign_up.cgi Step 3 (Finish): www.example.com/sign_up.cgi To track visitors' progress through a funnel with the same URL for each step, modify the tracking code to create a virtual URL for each step in the sequence that you want to track. For details on how to use this in your tracking code, see Virtual Pageviews in the _Asynchronous Migration Examples_guide, which shows how to do this in all versions of the tracking code. The following example shows how you might fabricate 3 URLs using the asynchronous tracking code: _gaq.push(['_trackPageview', '/funnel_G1/step1.html']); _gaq.push(['_trackPageview', '/funnel_G1/step2.html']); _gaq.push(['_trackPageview', '/funnel_G1/step3.html']); You would then define your funnel and goal URLs using the ones you created in the tracking code modifications.
Reporting & Analytics | | pookiepro0 -
How to track what people type on my text boxes on Google Analytics?
Hi there! In our website, we have a few text boxes that users need to use to complete the goal. The boxes aren't search boxes, but it's still important to us to track what people type on it. I'm looking for a way to track the data through the "event" feature in Google Analytics, but it seems that this tracker can only calculate clicks, or video views etc. Does anyone knows how to track do it?
Reporting & Analytics | | ivan.precisodisso0 -
Google Analytics Admin account not allowing us to add other users?
Our Google Analytics Administrator account is not giving us access to the User Manager, and because of that we are unable to add users; have you ever ran in to a problem such as this, if so what was your solution. Thanks a Billion impressions, Vijay E2qE9.jpg
Reporting & Analytics | | vijayvasu0 -
Tracking Required Form Fields in Google Analytics
I tried searching for this elsewhere but am having a hard time finding a good answer. Is it possible to track the effect of required form fields on conversions in Google Analytics? In other words, how do I track whether or not more/less people fill out a form if I make "Last Name" a required field? Thanks 🙂
Reporting & Analytics | | kylesuss0