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
-
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 -
Google Analytics Goal/Event/SOMETHING to show only Wordpress "Posts", not pages, etc
Hi all, Our site is build on Wordpress and formerly the post URL's had the typical date format at the beginning. This made it easy for me to look at, for example, all search traffic to the blog. I would just view URL's containing /2014/ and /2015/ and boom. We have since removed the dates from the URL's with proper redirects etc, which is great, but now I can't figure out a way to look at ONLY the blog in GA. I like to track a KPI of 'search visits to blog posts' and I can't figure out how to now. Can I set up a GA event that only fires when the post type template for blog posts loads? Some other solution? I'm lost here, and there's gotta be a good way to do it...
Reporting & Analytics | | 3DR0 -
Set Up of Goal Tracking with Google Analytics-$750 a Fair Price????
Greetings Moz Community! My firm operates commercial real estate website that contains 3-4 forms. Each form represents a goals. Google Analytics has been set up for years, but it does not track these form completions/goals properly. My SEO firm has offered to configure Goals on Google Analytics for $750. Is this a fair price? If the set up takes one hour, I am really over paying. But if this is a complex project that may take 7-9 hours the pricing seems OK. Also, the SEO firm will require an additional $750 in the future to set up event tracking. Is this excessive? I might add that my developer will need to add code to my web site. My SEO company has proven reliable and accurate. I can go to sleep at night knowing they are doing a good job. Where as my Argentinian developers really try their best, but perhaps because of the language barrier, they can make mistakes from time to time. I am willing to pay a premium to ensure that the job is done correctly domestically, however I don't appreciate over paying. Is the $750 payment for setting up Google Analytics reasonable assuming the job is done well??? Thanks,
Reporting & Analytics | | Kingalan1
Alan0 -
Track social shares of my webpage
Hello ! I've just implemented new images on my website and I would like to know what is the best tool to track them on social media (how many are tweeted, shared on facebook, etc.). The best would be a tool telling me that this photo was shared X times on faebook, Y times on twitter, etc; What is the best tools for you ? Tks a lot !
Reporting & Analytics | | AymanH1 -
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 -
Cookies/Tracking/Code developement
So. I have an online application form, on the website. It's maked with php, html and css. What i like to place on the email, is a cookie tracking system. For example, when someone search on the google for " web design ", and then see my result on google organic, comes the visitor to my site, charge the fields of application forms and click send. Than, me like an admin, i receive an email with informations of a customer, i see name/surname/etc.. but i like to integrate is for example, like to see a: IP from Visitors, who charged the fields Referrerr, if google, like to see which query he typed. How can i do this please?
Reporting & Analytics | | leadsprofi0 -
GA stopped tracking traffic, suddenly, why¿? :-/
2 days ago GA stopped receiving data. It only stopped for one account of all my projects. At this moment there are 5 persons navigating the site and these days there where numerous visitors as they contacted the support team thru the site. GA says that it's receiving the code, hw, I checked it twice. The tracking code is located below the footer, in the body. It was there for few years.... I also checked if there is some js conflict, negative. Is there something that could make the tracking to stop? Does anybody experienced similar problems¿? Should I be worried...¿? (and with SEOmoz server with issues not sure when will see new results.......) EDIT: In Web Master Tools I see results for indexing, with yesterday date, so I assume that the site crawling is ok and must be GA issue.
Reporting & Analytics | | MilosMilcom0 -
Using Google Analytics for tracking statistics of the HOMEpage
Hello, Lets say I have a website with the HOMEpage being http://www.page.com. There are various subpages e.g. http://www.page.com/page1, http://www.page.com/page2, http://www.page.com/page3 . Now when I use Google Analytics it gives me all kind of statistics for the subpages shown as /page1 /page2 /page3 ... (relative path). According to this pattern the HOMEpage should be just "/". Unfortunately I can't find "/" in any statistics. Is this normal? Thanks in advance
Reporting & Analytics | | guitarslinger0