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
-
Can't see backlinks in Search Console
Hello, We have 7 sites and have noticed that for one site, we don't see any backlink info in Search Console even if it's been linked for over 8 months. Other tools show thousands of backlinks, but Search Console is still pending. I also see very little info in regards to Performance even if we are getting thousands of hits a day. Could this be a sign of a bigger problem? In summary, the site is up and running, getting hits, getting backlinks, but Search Console still looks like it's a new site with no activity several months after being installed.
Reporting & Analytics | | CJolicoeur0 -
Do lots of event tracking via tag manager will it slow down my site?
Hi All, For my Ecommerce site I have done lots of tracking total I do have total 45 event tracking but many times one event, track many pages. So if visitors click on url or button then do my site speed affect because of these trackings? Thanks!
Reporting & Analytics | | pragnesh96390 -
Tracking 301 redirect traffic in Google Analytics
if I 301 redirect www.mywebsite.com to go to www.yourwebsite.com, how can I track the traffic in Google Analytics that is coming from mywebsite.com?? I don't think that's a referral traffic, is it?
Reporting & Analytics | | Armen-SEO0 -
Can I move Google tracking from one account to another?
Hi: We've recently taken over the hosting of a client's web site. Is there a way to move the Google Analytics tracking from the old host's account to the client's account without losing all the history?
Reporting & Analytics | | Stamats0 -
Help w/ Google Event tracking w/ new Universal analytics.js
I want to implement Google event tracking after my visitors complete an estimate form. The form provides them an approximate range of costs based on their widget and widget amount. I have the php coding done, but I don't know JS and I need to send an event upon completion of the estimate form. However, all of Google's examples are button click events. How do I send the event upon completing a form if there is no separate landing page? If I have my Google analytics code on the page as well, would simply adding the following the completed estimate code work?
Reporting & Analytics | | TheDude0 -
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 -
Tracking analytics on several domains
Hello, I am looking for some advice. I am working with a real estate client. They have a main website, and then several separate agent websites. The agent sites share some content with the main site, as well as having some unique content. My question is what is the best way to track visitors? Should I have separate Google Analytics accounts for each site, or should I use one account and separate profiles?
Reporting & Analytics | | ukao0 -
How do you track badges?
I have had some success these days with a couple of badges I have created. It wasn't too difficult for the efforts to result in a bunch of links as they where on topics people are very passionate about. My question is how do people usually keep track of what websites their badges end up on besides watching for analytics visits? There has to be an easier way to know who has used your badge on their website?
Reporting & Analytics | | connectiveWeb0