Tracking an onpage 'event'
-
Hi all
Wondering if anyone could help out with this one please. My client is a government backed free internet safety website and in the next few days they will be launching an update on all of their pages which will let people know if their browser is out of date. For example, when you go to their site you will get a message advising you to upgrade your browser for security reasons.
They have employed the following code to check the browser
The client are keen to know how many times in a period this message is shown to users. Any idea how one would go about tracking this please. Would it involve some custom GA work, would I be able to track the hits on https://wxxxx.org/javascript/update.js in GA? I'm a little stumped. Obviously I can tell how many people loaded the page but not sure how to work out what % of them see the javascript
Many thanks for your help
Carl
-
This should be pretty simple. Add a line to your onLoad that looks like an event:
window.onload=function(){
try {if ($buoop.ol) $buoop.ol();}catch (e) {}
var e = document.createElement("script");
e.setAttribute("type", "text/javascript");
e.setAttribute("src", "https://wxxxx.org/javascript/upda..."); (have replaced the domain name for this example)
document.body.appendChild(e);_gaq.push(['_trackEvent','browser-warning','{browser name}']);
Whenever the message is shown, an event is fired.
-
You can do event tracking now within Google Analytics.
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
You should be able to set up an event, and then call the event tracking within your script inside the try{} loop.
-
Sorry, had a thought which is probably foolish but will share anyway
Could I set up a custom Google Analytics and generate a unique GA tracking code and place it inside of the above script or would it still be picked up by the whole page?
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
-
Cross-domain / subdomain tracking in GA?
Hi there, My client has a site website.com and a booking engine, booking.website.com They are currently tracking the main site and the booking subdomain as two separate properties in the same GA account. The issue is we can't see where users are originating on the subdomain property; it's all being counted as referral. My understanding is we need to set up subdomain tracking using Google Tag Manager in order for GA to pass the user data between the two subdomains. This is fine, except for this one line I am reading on Google's guide to cross-domain tracking: Subdomains If you have updated your tracking code to analytics.js, then no additional configuration is required to track subdomains. You can use cross domain tracking to collect data from a primary domain, like www.example.com, and a subdomain, like www.subdomain.example.com, in a single Analytics account property. That last line makes it sound like we should be using cross-domain tracking for this purpose. Are we correct in setting up subdomain tracking and NOT cross-domain tracking to be able to track users across subdomains on the same domain?
Reporting & Analytics | | FPD_NYC0 -
What's the new "Value" column in GWT about?
I was checking out our GWT this morning and noticed a new column on the far right that was labeled "Value". Currently, there isn't anything of value (no pun intended) listed just $Nan. Anyone else see this or know what it might be? 014pThY
Reporting & Analytics | | Shawn_Huber0 -
How can I track my rankings on Google Images?
I noticed a small amount of traffic coming from a particular very generic keyword. Being pleasantly surprised that we are ranking for this, and after some digging, I found that we are actually ranking in Google images, rather than in the web results. How can I track whether other keywords are ranking in Google images? I use Rank Checker to track keywords in the main web results, but this doesn't have a function for Google Images. Help please - thanks.
Reporting & Analytics | | TheJewelleryEd0 -
Why are there url's in my np Keywords in google analtyics?
I have been scratching my head at this one. On my not provided keywords, there is a url. Keyword is the primary dimension. It doesn't makes sense why there would be url keywords for pages with a different url. For example, the keywords for page www.xyz.com/abc np - /someotherurl.com Thanks for your insights in advance!
Reporting & Analytics | | konverge0 -
Google Analytics subdomain ecommerce tracking flatlines :-(
Buongiorno from 19 degrees C wetherby UK 🙂 This website http://www.philpotts.co.uk/ contains a shop sub domian @ http://shop.philpotts.co.uk/. I configured the site Ga analytics code to include the subdomain (see below code). I had to do this as i was getting refferal data from the actuall subdomain. But after following the instructions on p117 of cutroni's ga book things have gone wrong, mainly now eCommerce data has dissapeared 😞 So my question is please: "Why has installing the GA code above caused eCommerce tracking to suddenly go dead?" Grazie tanto,
Reporting & Analytics | | Nightwing
David0 -
Ecommerce tracking problem with multiple domains on 1 web property
We recently launched 13 product marketing sites based on a Wordpress Multisite setup. To track all 13 sites we decided to use one web property, so we can use the same tracking code for all domains. To track the sites seperately, we set up a profile for each product site with a hostname filter. This works well for most stats, but eCommerce tracking is where the problem starts. Per profile we obviously want to track the products purchases on that website only. What happens now is that all purchases from all product sites are tracked on all profiles. How can we change this? Should I alter the eCommerce tracking code or can I fix this with an additional filter per profile? Thanks for your help Mozzers! Regards, Pieter van Diggele
Reporting & Analytics | | RBO
Online Marketing Executive
Elsevier Opleidingen0 -
Tracking Multiple Top Level Domains in GA
Hi, I am setting up Google Analytics for www.example.co.uk and www.example.ie Is this as simple as just adding GA tracking code 'track Multiple top-level domains'? With this method how can I distinguish between each site's incoming traffic? Do filters needed to be created? Thanks in advance 🙂
Reporting & Analytics | | daracreative0 -
Duplicate content? Split URLs? I don't know what to call this but it's seriously messing up my Google Analytics reports
Hi Friends, This issue is crimping my analytics efforts and I really need some help. I just don't trust the analytics data at this point. I don't know if my problem should be called duplicate content or what, but the SEOmoz crawler shows the following URLS (below) on my nonprofit's website. These are all versions of our main landing pages, and all google analytics data is getting split between them. For instance, I'll get stats for the /camp page and different stats for the /camp/ page. In order to make my report I need to consolidate the 2 sets of stats and re-do all the calculations. My CMS is looking into the issue and has supposedly set up redirects to the pages w/out the trailing slash, but they said that setting up the "ref canonical" is not relevant to our situation. If anyone has insights or suggestions I would be grateful to hear them. I'm at my wit's end (and it was a short journey from my wit's beginning ...) Thanks. URL www.enf.org/camp www.enf.org/camp/ www.enf.org/foundation www.enf.org/foundation/ www.enf.org/Garden www.enf.org/garden www.enf.org/Hante_Adventures www.enf.org/hante_adventures www.enf.org/hante_adventures/ www.enf.org/oases www.enf.org/oases/ www.enf.org/outdoor_academy www.enf.org/outdoor_academy/
Reporting & Analytics | | DMoff0