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
-
How do I get compete.com to track my data
Is there a tracking code for them? I cannot find a way to get them to track my site data. I know it seems trivial, but it is sadly a big tool in my industry so I need to get my data on their site
Reporting & Analytics | | Atomicx0 -
Are RSS fees tracked by Google Analytics?
In both the new GA and former version, how are RSS feeds handled by Google Analytics. If not, is there an easy means by which to account for this traffic, in order to have a better picture of traffic. Thanks. Alan
Reporting & Analytics | | ahw0 -
ECommerc site redirect to external site when add to cart. Need HELP to track sales!!!
Hi, I buil this site on WordPress, http://www.pilatesboisfranc.com When you go on <<plan &="" pricing="">> on the menu you can purchase a package online.</plan> When you click ''Get Started Now'' or ''Add to Cart'' the buyer is redirect to this external site: mindbodyonline.com QUESTIONS: Can I track my sales on Googles Analytics? Can I creat a goal on G.A. ? I found this video: https://getsatisfaction.com/mindbody/topics/chalk_talk_how_to_setup_google_analytics Is this the right way to do this? About goals, a simple goal I would like to create is, one purchase. Can I acheive that? Not shure about Goals. When I test and purchase, URL is always the same https://clients.mindbodyonline.com/ASP/home.asp?studioid=30371 I'm know only very basics stuff when it is time to play in Analytics, I hope you can provide help in details. Thank you, BigBlaze
Reporting & Analytics | | BigBlaze2050 -
What is best practice for tracking RSS feed subscribers
What is the most accurate/achievable way of tracking data about subscribers to your RSS feed through Google Analytics? With standard WordPress sites, we place the RSS link to Feedburner so we could track statistics. However it wouldn't track the way that I use it. I use Pulse on an Android Tablet to read my feeds offline on the bus each morning. At home, Pulse automatically downloads the latest feeds wirelessly overnight. So then I can read them without a connection. The obvious downside for my reading experience is that I only get what is contained in the feeds. If the company only includes an excerpt, it's too annoying to read the teaser and be unable to connect and follow a link. So I only subscribe to feeds that contain the full post. Yeah to seomoz, aimclear, SEL, adwordsblog. I dont subscribe to bruceclays blog, much as i'd like to, because it doesn't contain the full feed. That's probably deliberate on their part, because I have to consciously visit their blog on my desktop at work, to see the whole post. The other problem with say Pulse, is how it locates the feed. I typed in the URL, and Pulse subscribed me. I assume that Pulse simply looked for the domain.com/feed URL and added that, rather than look for feeds2.feedburner.com/domain. I looked at Feedburner stats and they didn't go up for 2 days, so basically it didn't track me. Would it be as simple as using the Google URL builder to add parameters to each post in the RSS feed? Eg utm_source=feedreader, utm_medium=rss, utm_campaign=tracking. But that still wouldn't track offline users. I assume that most people are also not going to paste the Feedburner URL into their FeedReader, but would let the platform auto-detect the feed. Any suggestions?
Reporting & Analytics | | ozgeekmum1 -
Best practices to track blog.mydomain.com in Google Analytics?
What is the best practice in Google Analytics? Tracking blog.mydomain.com + mydomain.com under the same profile? Or creating separate profiles for each blog.mydomain.com and mydomain.com? Thanks!
Reporting & Analytics | | gerardoH0 -
Google Analytics Goal Tracking Head Match w/ Query Strings
Hello, I have what should be a simple question here but there is a small nuisance I am trying to make sure I have configured correctly. We have a product based website w/ no e-commerce because they sell through a dealer network. All these product pages have "Where to Buy" links and the URL after you click where to buy always uses the query string ?r=XXX. Example: www.mysite.com/product/category/subcategory/product-name?r=12345 I want to setup a goal in GA with a URL and configure head match on the "?r" but which of the following is exactly how it should be configured with the "Goal URL" ?r= ?r r= Does it matter, because I had it setup as "?r" and it was never registering any goals. Do I need to leave off the "?" and just have it be r= Thanks in advance for the respones.
Reporting & Analytics | | Bevelwise0 -
Campaigns: How to Decide What to Track?
Hi There! I'm new to SEOMoz, but not completely new to SEO. A bit of background: 9 year old content site, medium traffic (low 7 figures unique visitors yearly) with about 85% coming from SE traffic. (It was 75% but Panda seems to have bumped that up.) I've created this with zero keyword research. I just built a site that I would have liked to have found online. It's a weight loss/fitness website with tools, calculators and articles. I'm going to be working harder on getting traffic from other sources, but I signed up here because I want to make sure I'm taking full advantage of my site when it comes to SEO. Having said that, I'm at a loss as to what to do with a campaign. My site is huge, with thousands of pages and keywords. I started a campaign, threw in a few keywords and some competitors just to get started, but this seems so...directionless. How do I figure out what I want to analyze? Thanks! Suzanne
Reporting & Analytics | | Suzany0 -
Is IP tracking of visitor allowed?
Hi, Google Analytics does not provide IP addresss of the visitors. What if i develop some in-house tracking mechanism to do so? Is it allowed or will Google penalize me if it comes to know about it? Thanks
Reporting & Analytics | | IM_Learner0