Ga event tracking and GAC code placement
-
Just relaunched website and since then specific event tracking has zeroed. I copied event tracking directly from old site so it should work. Overall analytics are fine. Only variable I can think of is where google analytics code is placed. Does GAC code need to be on HTML header or at end of body specifically for event tracking to work? Example: Steripen.com/freedom/... When user clicks "REI" icon, this tracks an event that a user clicked on one of our"retailer links." Any feedback is greatly appreciated.
-
Yeah, I was going to correct myself there. It is .
-
Actually, Francisco, the optimal location for the async version of the GA tracking code is just before the closing tag. You'll get much more accurate data and because the code is asynchronous, the JavaScript won't slow down the page load.
Paul
<object id="plugin0" style="position: absolute; z-index: 1000;" width="0" height="0" type="application/x-dgnria"><param name="tabId" value="undefined"> <param name="counter" value="201"></object>
-
Martjin, I did find that answer early this morning and tested, then went to bed. Just woke up and, indeed, after changing to integers, it worked fine.
Now it's just my ecommerce vaules that are not displaying. I can't imagine the integer value would apply to ecommerce in ga as rounding is not expected.
Thanks for your feedback.
Tim
-
Your event tracking code seems fine.
_gaq.push(['_trackEvent', 'Videos', 'Video Load Time', 'Gone With the Wind', downloadTime]);
Your placement should GA tracking code should be before the . Use the async GA tracking code. Where is your event tracking not working; under Events or under Goals?
-
Hi Tim,
Within this case you used the value: 119.95 where this value needs to be an integer. This could be what is causing your troubles.
Hope this helps!
-
A second set of eyes is greatly appreciated. Thanks for responding and a good point actually. here's the code from the page I referenced:
<a <span="">onclick</a><a <span="">="_gaq.push(['_trackEvent', 'Buy Now', 'www.rei.com', 'Freedom Portable Water Purifier',119.95]);" href="</a>http://www.rei.com/product/824898/steripen-freedom-water-purifier" target="_blank">title="Buy SteriPEN Freedom at REI.com" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAABi0lEQVQ4EZWSz0sCURDHv8RmKWqCh/Ji4KGDh/AehAf/gSDw5H/jTfY/EDy4IYiBihBaorkn0SV/UIZEKkmGRgiSJgTGCO/B01VoLm/ezHc++2Z2sNhinW5nkbpJbVEsFjvYYmpTRSgTQq/f26jaCBh8DKDcKeh/9RFJR/4PCGfCaA/bsFvsyD/l0e11dSG6L2g+N5GqpJbFVDWcDBG8CmI+na9BdAG1Vg2eYw8XW/YtmM6mUB9UHmOOLiBwEYB1z4rJz4Tp4D/3w3fm43fm6AI0TUOpXQJ9mYxAyr2C8XjM6vi5BqA+5aSM2e+MiwhUfa0ilo3xGHPWAPFsHPX3OoySkWmWp2HXgHQ5jdHnSIgLAPr32osG54FTENGFXjH6HiFZSAo5AUCZS+8lzCaz0ALFaQ7eUy9chy5hFgLAceRAoV5A462x1oIkSSi3ynCfuGGz2Yi5NAFA25ar5UDiVaOZ0FrL17KwUAIgehtdilYHyGC01sVGEZXHCguBA9j6mowmntzkJIoJnvoDa5nPyI8bIWoAAAAASUVORK5CYII=" alt="Buy SteriPEN Freedom at REI.com" />REI.com
Right now my GAC is just beore
-
A second set of eyes is greatly appreciated. Thanks for responding and a good point actually. here's the code from the page I referenced:
<a <span="">onclick</a><a <span="">="_gaq.push(['_trackEvent', 'Buy Now', 'www.rei.com', 'Freedom Portable Water Purifier',119.95]);" href="</a>http://www.rei.com/product/824898/steripen-freedom-water-purifier" target="_blank">title="Buy SteriPEN Freedom at REI.com" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAABi0lEQVQ4EZWSz0sCURDHv8RmKWqCh/Ji4KGDh/AehAf/gSDw5H/jTfY/EDy4IYiBihBaorkn0SV/UIZEKkmGRgiSJgTGCO/B01VoLm/ezHc++2Z2sNhinW5nkbpJbVEsFjvYYmpTRSgTQq/f26jaCBh8DKDcKeh/9RFJR/4PCGfCaA/bsFvsyD/l0e11dSG6L2g+N5GqpJbFVDWcDBG8CmI+na9BdAG1Vg2eYw8XW/YtmM6mUB9UHmOOLiBwEYB1z4rJz4Tp4D/3w3fm43fm6AI0TUOpXQJ9mYxAyr2C8XjM6vi5BqA+5aSM2e+MiwhUfa0ilo3xGHPWAPFsHPX3OoySkWmWp2HXgHQ5jdHnSIgLAPr32osG54FTENGFXjH6HiFZSAo5AUCZS+8lzCaz0ALFaQ7eUy9chy5hFgLAceRAoV5A462x1oIkSSi3ynCfuGGz2Yi5NAFA25ar5UDiVaOZ0FrL17KwUAIgehtdilYHyGC01sVGEZXHCguBA9j6mowmntzkJIoJnvoDa5nPyI8bIWoAAAAASUVORK5CYII=" alt="Buy SteriPEN Freedom at REI.com" />REI.com
Right now my GAC is just beore
-
Please show me your event tracking code. I can probably figure it out for you. CHeck your source code because MANY times the code will get stripped by the editor if flipping from HTML to Visual.
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
-
Filter Tracking works fine at staging site but not on LIVE site why?
Hello Expert, For my ecommerce site I want to track filter url's like price range, size, width, color etc and fully filter url should display in google analytic. I have implemented filter tracking at staging server and it works perfectly but on LIVE site it not show me full filter url. Do you guys think any parameter which i have configured in search console affect this? Note - I have configured in this way - http://webmasters.stackexchange.com/questions/93008/how-to-track-a-product-filter-in-the-product-list-view-with-google-analytics My filter url's are given below. And in search console I have configure two parameters. 1) effect - Sort, Crawl - No urls 2) FT - effect- ( - ) , crawl - Let google bot decide. But as per me this parameter is for crawling should not affect tracking right? mysite.com?FP=0&filtSeq=Price&Sort=BS
Reporting & Analytics | | adamjack
mysite.com?FT=7581&filtSeq=Type&Sort=BS
mysite.com?FT=1042&filtSeq=Colour&Sort=BS In robot file nothing is block. In analytic it showing me url till mysite.com only where as in staging it shows me full filter url. Thanks!0 -
How do I track a primary domain and a subdomain as single site in Google Analytics?
Our website consists of a primary domain (marketing focused) and subdomain (ecommerce platform). The two sites look and function as one site even though they are using different technology. I would like to track the primary domain (example.com) and the subdomain (shop.example.com) as a single site in Google Analytics. The subdomain will be set up with GA ecommerce tracking as well. Can someone provide an example of the GA snippet that each would need?
Reporting & Analytics | | Evan340 -
Two Analytics Code
Hi Moz Community! I've been working with a client’s website and found it has 2 analytics code with same ID. I need to understand which one is correct before removing anyone of them, below are the both scripts. First one Second one Any help would be appreciated! Regards, S
Reporting & Analytics | | ShaunPhilips0 -
Analytics code removed and still collecting data
Google analytics code was removed from a website and then it started tracking a couple of days later to only stop again? How can that happen? Has the developer not removed the old code properly? Can the code be injected remotely?
Reporting & Analytics | | GardenBeet0 -
No paid conversions shown in GA Multi Channel Funnel
For some reason paid conversions are not showing in the Multi Channel Funnel and nothing shows under the adwords tab. What would be the reason?
Reporting & Analytics | | jbk3650 -
Where should I insert the code when I track an event on GA?
hi mozzers, I am trying to setup my first event to count the numbers of downloads of an infographic(pdf file) we just created on GA and after some research I figured that I should add this piece of code (below) but where exactly? <colgroup><col width="386"></colgroup>
Reporting & Analytics | | Ideas-Money-Art
| _gaq.push(['_trackevent', 'PDF', 'Download', 'name of file']); | Should I put it just in between _gaq.push(['_setDomainName', 'coit.com']); and _gaq.push(['_trackPageview']); ? Please provide details because I ve never done this before Thanks 🙂0 -
Can anyone shed some light on mobile inbound call tracking?
Is there any way to track the call button from the local listings within the mobile SERPs??
Reporting & Analytics | | cybercom0 -
Sort referring sites by visit change over time comparison in GA
I can't believe I've never done this before, so I'm going to assume that I previously must have figured it out via excel, but I'm hoping there's an easier way. So I want to compare the referring sites between April and May and see which have sent (specifically) less traffic. The problem with doing a comparison in GA is that it only sorts by the highest traffic for May, when actually I want to see the largest negative change (by number, not percentage) between April and May. Is there a way to do this via the dashboard or am I just going to have to play about in excel for 10 minutes?
Reporting & Analytics | | StalkerB0