How do i implement event tracking
-
Hi,
Please excuse me for being too simplistic or dumb.
I haven't had any experience in Event tracking so far. So, Please help me out
I want to track how many persons have clicked on "subscribe for Newsletter" button on website - http://bit.ly/w7iwdh
Pls can anyone paste here the code to implement this ?
-
files/map.pdf does this mean that map.pdf ( or whatever be name of PDF file )
have to be placed in files folder ?
-
So, there is no need to use /salesForms/orderForm1 in the code ?
is the code below correct ? Pls correct it, if you wish
Actually i wanted a simple code to understand things. Afterwards
i can go to complicated code like you people do
[Download PDF](http://www.example.com/files/map.pdf) ```
-
The code goes into the link which points to the download page (just as you have thought )
And the /salesForms/orderForm1 was a copy-paste from the article I have linked
Gr.,
Istvan
-
Thanks. I understood quite a few things. Not a bad start
Why
/salesForms/orderForm1 ? what for ?
And where should i put the code ? In the link which when clicked goes to PDF file ?
-
your code should look like something:
[onClick="_gaq.push(['_trackEvent', 'Downloads', 'PDF', '/salesForms/orderForm1.pdf']);">Download PDF](<span>http://www.example.com/files/map.pdf) The "MyMap" you see in the code above is a Label. You can read further on: http://code.google.com/apis/analytics/docs/tracking/eventTrackerGuide.html#Labels From the article which is linked above:
Setting Up Event Tracking
Before you can view event tracking results in your reports, you must set it up on your site following these steps.
-
Set up tracking on your site. Make sure you have set up tracking for your website. For information on setting this up, see Tracking Sites.
-
Call the
_trackEvent()
method in the source code of a page object, widget, or video.The specification for the
_trackEvent()
method is:_trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
-
category (required)
The name you supply for the group of objects you want to track.
-
action (required)
A string that is uniquely paired with each category, and commonly used to define the type of user interaction for the web object.
-
label (optional)
An optional string to provide additional dimensions to the event data.
-
value (optional)
An integer that you can use to provide numerical data about the user event.
-
non-interaction (optional)
A boolean that when set to
true
, indicates that the event hit will not be used in bounce-rate calculation.
-
-
View the reports. Once event tracking has been set up and working on your site for a day, go to the Content section of the reports and view Event Tracking.
onClick="
-
-
Thanks for replying so quickly.
Actually i wanted to learn how to track PDF files in GA.
1. Where do i put this code ?
2. What is meant by MyMap in the code?
-
Hi Atul,
Do you have a thank you page after subscribing? if so, then you can track it with google analytics.
Set up a goal in GA: Decide one of the three types of goals you want. This can be URL Destination, Time on Site, or Pages/Visit. You will need the URL destination. just enter the Thank You page's URL and it is set up.
That should be the scenario.
I hope that helped,
Istvan
useful video step-by-step: http://www.youtube.com/watch?v=no9LuXnmLao
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
-
Issue with GA tracking and Native AMP
Hi everyone, We recently pushed a new version of our site (winefolly.com), which is completely AMP native on WordPress (using the official AMP for WordPress plugin). As part of the update, we also switched over to https. In hindsight we probably should have pushed the AMP version and HTTPS changes in separate updates. As a result of the update, the traffic in GA has dropped significantly despite the tracking code being added properly. I'm also having a hard time getting the previous views in GA working properly. The three views are: Sitewide (shop.winefolly.com and winefolly.com) Content only (winefolly.com) Shop only (shop.winefolly.com) The sitewide view seems to be working, though it's hard to know for sure, as the traffic seems pretty low (like 10 users at any given time) and I think that it's more that it's just picking up the shop traffic. The content only view shows maybe one or two users and often none at all. I tried a bunch of different filters to only track to the main sites content views, but in one instance the filter would work, then half an hour later it would revert to no traffic. The filter is set to custom > exclude > request uri with the following regex pattern: ^shop.winefolly.com$|^checkout.shopify.com$|/products/.|/account/.|/checkout/.|/collections/.|./orders/.|/cart|/account|/pages/.|/poll/.|/?mc_cid=.|/profile?.|/?u=.|/webstore/. Testing the filter it strips out anything not related to the main sites content, but when I save the filter and view the updated results, the changes aren't reflected. I did read that there is a delay in the filters being applied and only a subset of the available data is used, but I just want to be sure I'm adding the filters correctly. I also tried setting the filter to predefined, exclude host equal to shop.winefolly.com, but that didn't work either. The shop view seems to be working, but the tracking code is added via Shopify, so it makes sense that it would continue working as before. The first thing I noticed when I checked the views is that they were still set to http, so I updated the urls to https. I then checked the GA tracking code (which is added as a json object in the Analytics setting in the WordPress plugin. Unfortunately, while GA seems to be recording traffic, none of the GA validators seem to pickup the AMP tracking code (adding using the amp-analytics tag), despite the json being confirmed as valid by the plugin. This morning I decided to try a different approach and add the tracking code via Googles Tag Manager, as well as adding the new https domain to the Google Search Console, but alas no change. I spent the whole day yesterday reading every post I could on the topic, but was not able to find any a solution, so I'm really hoping someone on Moz will be able to shed some light as to what I'm doing wrong. Any suggestions or input would be very much appreciated. Cheers,
Technical SEO | | winefolly
Chris (on behalf of WineFolly.com)0 -
301 or 404 old Event pages
I have a site that lists events and then removes them from the site once the date and event has passed. Is it best to let the old event page 404 or 301 back up to a subfolder that lists the current events?
Technical SEO | | Marketing_Today0 -
Why is Coyscape showing content duplication error even after implementing 301 redirect ?
We are maintaining the corporate website of one of our prestigious clients "FineTech Toolings" (http://www.finetechtoolings.in). Recently I had raised a question regarding "2 websites running paralley in 2 diferent domains, i.e. 1 organisation having 2 different websites on 2 different domains". Recently my domain changed from http://www.finetechtoolings.co.in to http://www.finetechtoolings.in via 301 redirect, but still I am facing content duplication issue as per Copyscape. Hence I am having a small doubt regarding the same. Please note the following question very carefully and provide me the exact problem and the solution for the same: Even though I have implemented 301 redirect (http://www.finetechtoolings.co.in is redirected to http://www.finetechtoolings.in), which is completely ok as per the SEO rules, why is copyscape still showing that duplicate content exists in the former website? I think I am clear enough with my question.
Technical SEO | | KDKini0 -
Should I use Event Schema for a page that reports on an event?
I have a question about using Schema data. Specifically: Should I use Event Schema for a page that reports on an event? I provide high-quality coverage (reporting) about new products being introduced at an industry trade show. For the event, I create a single page using the event name, and provide a great deal of information on how to attend the show, the best places to stay and other insider tips to help new attendees. Then during the show, I list the new products being introduced along with photos and videos. Should I use event schema data for this page, or does Google only want the event organizer to use that data? Any benefits or drawbacks to using event schema? Thanks! Richard
Technical SEO | | RichardInFlorida0 -
Schema.org implementation for physician's office vs physician herself?
Hi, Regarding schema.org microdata, which page(s) should have the microdata? 1) http://schema.org/Physician -- appears to be about the office. Since we have all of the contact/address info in the footer on each page, should we do the same with microdata? I can't seem to find a suggested implementation on schema.org Assuming an office has multiple MDs, how should the docs be listed since the physician schema appears to be for the office, not for the individual doctors? Thanks for any insight!
Technical SEO | | Titan5520 -
Best way to manage SEO for a massive events listing website.
I run a website that tracks entertainment for the entire state of South Dakota. While I've made some fantastic strides in gaining traffic, I feel lost on how to manage all those entries in an SEO friendly manner. I have a TON of errors showing on my crawl diagnostics and I just don't know what to do. The nature of the website is such that there are going to be duplications all over the place. I know that I can help some of this by getting my canonical links setup properly (that's coming in my next version of the site's theme), but what else should I do to make those event listings friendly for the SE's?? http://www.entertainsd.com
Technical SEO | | jcherland0 -
Anyone having issues using Keyword Analysis and Rank tracking lately?
Seems it works once, maybe, then replies with a message that it can't complete the process when trying another keyword. _Cindy Barnard
Technical SEO | | CeCeBar0 -
Tracking a Crawl error
Hi All, If you find a crawl error on your page. How do you find it? The error only says the URL that is wrong but this is not the location. Can i drill down and find out more information? Thank you!
Technical SEO | | wedmonds0