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 -
Is my tracking code incorrect?
I inherited a website that has a host of issues. I set up Goal Conversions for lead generation and am getting this URL listed as a Goal Completion Location /l/24672/2014-07-31/b4dg5 I can tell it is a date but have no other insight into what or where this page is. Does anyone have experience with this and can offer a fix? A related question is how can I find the URL that triggers the Goal Conversion. I tried editing the goal but it doesn't show the URL anywhere. And the Goal Completion Location is sort of a misnomer because it lists the URL prior to the completion. Thanks!
Reporting & Analytics | | Nobody15969167212220 -
Where have the 'most changed keyword rankings' gone from the weekly summary emails?
Since the change to Moz we have noticed that the weekly summary emails do not show the 'most changed keyword rankings' table. We found these extremely helpful and would be disappointed to see these go. Are these going to make a come back?
Reporting & Analytics | | RedAntSolutions2 -
I have data missing in Google and don't know who to turn to for help
Hi everyone, I know this isn't the 'Google help forum' but I'm stuck and I hope someone here might be able to point me in the right direction. For a period last month - Thursday 22nd to Sunday 25th November Google Analytics reports our site as having 0 visits. In addition we have two days which were strangely low - Weds 21st 105 visits, Weds 28th Nov 78 visits. We normally get between 1000 and 1200 visits on a weekday from a global audience (I know that was the Thanksgiving weekend, but the US accounts for ~10% of total traffic). Has anyone else had this problem? If so, what did you do? The "report a bug" board on the Google help forum has a few entries like this, people with 0 visits shouting "help!" into the void with no response. Ideas?
Reporting & Analytics | | StevenHowe0 -
How to track link building? What metrics?
I'm an SEO newbie (my main roles are front-end designer and content manager).
Reporting & Analytics | | RSGregC
I've been managing our company's effort to generate links. In the past, trying to develop relationships has gone nowhere. As a result, we're currently mostly creating good content ourselves and posting it on Web2.0 sites (weebly, etc.) and linking back to our site, and then using UAW (unique article wizard) to create a second tier of links to those links. We've been doing this for a while, and our traffic from SEO is going up - but we don't really know how to track our work. Can you please
a) give your opinion about our approach, and
b) tell me which metrics we should be using, and which tools for these metrics? Thank you so much
Greg0 -
Why isn't Google showing the first keyword result in Analytics anymore?
Just checked my Google Analytics traffic sources under organic search and it dosen't display the first keyword, it says "not provided" is there another way of determining the #1 organic searched keyword that my site was found under?
Reporting & Analytics | | Randog0 -
Is IP tracking of visitor allowed?
Hi, Google Analytics does not provide IP addresss of the visitors. What if i develop some in-house tracking mechanism to do so? Is it allowed or will Google penalize me if it comes to know about it? Thanks
Reporting & Analytics | | IM_Learner0 -
Tracking SEO tests
Trying to get some best practices on testing SEO changes. We are going to make a bunch of changes on subsets of pages. Say testing about 5 different on-page changes. Originally we were going to submit separate Sitemaps to GWT and see if our test sets get indexed, how quickly, etc. But we noticed that GWT says some pages in our Sitemaps aren't indexed even though we know they are (what gives?). So we thought, for each test, let's put a unique code on the page so we can see how many get indexed by Google. But that doesn't solve the issue: how many people clicked on our test pages. So we are thinking of putting a tracking pixel on the test pages, specific for each test. But then I am thinking, why not just create a separate Google Analytics profile and place that code on the test pages (set up goals to track visits per test since we aren't going to change the actual URLs). and on and on This is where you come in. What kind of tracking do you implement when you set up tests? Advice appreciated! E
Reporting & Analytics | | ErinTM0