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
-
ECommerce Tracking in Analytics - Should I use a plugin or do it manually?
Hi, I have a WordPress site (woocommerce integrated). I would like to know should I use a plugin to enable e-commerce tracking in Google Analytics or I should do it manually with GTM. Which is a better way? Will using a plugin to enable e-commerce tracking slow down my site? Any thoughts? Thanks in advance.
Reporting & Analytics | | Mr.Suren0 -
Referral Data Q's
1. We recently ran a promotion on both FB and Reddit, which is https, linking to our non-https site. We utilized UTM links to our landing page. Our GA campaign data returned extremely low hits in comparison to what we actually received (and recorded via FB/Reddit dashboard). Obviously our Direct traffic spiked during these times, caused by a secure to nonsecure referral, I'm sure. I'm also noticing a spike in referral traffic from lm.facebook.com that correlates to the ad times. Does this mean Facebook's link shim is stripping away my UTM data? My question is why we receive SOME properly UTM-tagged referral traffic in our campaigns? What's allowing some of it to go through? 2. I've tagged our email signature links with UTM as well, hoping to clean up some of our Direct traffic. I understand that external clients like Outlook and Thunderbird likely won't pass referral data, but do hosted clients like Gmail, Yahoo, and such? And if so, would the https to http difference obstruct this again? I'd love some insight onto these questions, especially if I'm off the mark with a few of my assumptions there.
Reporting & Analytics | | kirmeliux0 -
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 -
Tracking Google places (7 pack listing) traffic in google analytics
Is there a way to see Google Places traffic (traffic from users clicking through the 7 pack listings) segmented in Google analytics ? Normally is it just lumped together with the organic traffic ? Can you see the search phrases used to find your site, or do they also show up under 'not provided' when from Google Places. Im aware i can see some limited data in the Google Places analytics, but these seem to be 2 days behind when ever i view them.
Reporting & Analytics | | Sam-P0 -
Why would our client's site be receiving significant levels of organic traffic for a keyword they do not rank for?
We have a client that has received 100+ organic visits for the keyword 'airport transfers', yet the site does not rank in the top 100 search results for this keyword. We have checked that it is not untagged PPC traffic. Truly baffling. Can anybody help?
Reporting & Analytics | | mrdavidingram0 -
GA Goal Tracking for Proactive Chat
Hi all, Just wondering whether anyone knows how I'd be able to track Proactive Chats as a goal in Google Analytics? So when someone visits our site, and we proactively contact them by initiating a chat (rather than a reactive chat where the visitor initiates it). Thanks!
Reporting & Analytics | | AdrianCordiner0 -
Haven't seen anything like this
I personally haven't seen anything like this before. I am optimizing my first worldwide page. The rank checker at seomoz and another rankchecker as well says that I achieve rankings in the Us and in the UK as well for my 2-3 word terms. However if I copy a paste a whole sentence from either of my pages (8-10 words) google can not find my site. If I put the terms in quotes than it is ok, but it still cannot find the home page. Not any sentence with or without quotes from the home page, although this page has the most incoming links. Anybody any idea how can it be?
Reporting & Analytics | | sesertin0 -
Tracking Required Form Fields in Google Analytics
I tried searching for this elsewhere but am having a hard time finding a good answer. Is it possible to track the effect of required form fields on conversions in Google Analytics? In other words, how do I track whether or not more/less people fill out a form if I make "Last Name" a required field? Thanks 🙂
Reporting & Analytics | | kylesuss0