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
-
Sudden drop in traffic since website redesign – can't spot double firing sessions pre-update
Hi all, We launched an updated website around mid-April and have seen a long-term drop in unique page views and sessions since then. Between 25-35%. Page views returned to normal within a month, however. In terms of acquisition, we've not lost referrals or direct traffic, just organic sessions. I haven't seen any significant Google updates except for 'Fred' but that was in March (pre-website update). We did have to do some 301s and fix up an HTML and XML sitemap, etc, post launch – but that's been in place for a while now so shouldn't still have such an effect? We are also struggling with load speed at the moment, working on this at the moment. Didn't think this had a such a significant impact on ranking however. We've lost mostly non-UK traffic, especially USA. We're actually climbing rankings for a lot of new keywords I'm targeting, so I can't see how our SEO has been hampered. Frustratingly, I wasn't using Search Console or Moz Pro before this update, so can't compare much in the way of keyword traffic (I know I feel very silly now). I don't know if it's a reporting issue (I wish it was). I mean we had both GTM and GA tags on the website (I didn't know this until I looked into it) but these were present post website-launch. And I haven't found enough double firing sessions or page views to suggest we used to be getting double figures anyway. Before this, we were ranking brilliantly and getting more organic traffic than ever. All the best,
Reporting & Analytics | | landport0 -
Page Tracking using Custom URLs - is this viable?
Hi Moz community! I’ll try to make this question as easy to understand as possible, but please excuse me if it isn’t clear. Just joined a new team a few months ago and found out that on some of our most popular pages we use “custom URLs” to track page metrics within Google Analytics. NOTE: I say “custom URLs” because that is the best way for me to describe them. As an example: This page exists to our users: http://usnews.rankingsandreviews.com/cars-trucks/Ram_HD/2012/photos-interior/ But this is the URL we have coded on the page: cars-trucks/used-cars/reviews/2012-Ram-HD/photos-interior/ (within the custom variance script labeled as “var l_tracker=” ) It is this custom URL that we use within GA to look up metrics about this page. This is just one example of many across our site setup to do the same thing Here is a second example: Available page to user: http://usnews.rankingsandreviews.com/cars-trucks/Cadillac_ATS/2015/ Custom “var l_tracker=” /cars-trucks/2015-Cadillac-ATS/overview/ NOTE: There is a small amount of fear that the above method was implemented years ago as a work-around to a poorly structured URL architecture. Not validated, but that is a question that arose. Main Questions: Is the above implementation a normal and often used method to track pages in GA? (coming from an Omniture company before – this would not be how we handled page level tracking) Team members at my current company are divided on this method. Some believe this is not a proper implementation and are concerned that trying to hide these from Google will raise red flags (i.e. fake URLs in general = bad) I cannot find any reference to this method anywhere on the InterWebs - If method is not normal: Any recommendations on a solution to address this? Potential Problems? GA is currently cataloguing these tracking URLs in the Crawl Error report. Any concerns about this? The team wants to hide the URLs in the Robots.txt file, but some team members are concerned this may raise a red flag with Google and hurt us more than help us. Thank you in advance for any insight and/or advice. Chris
Reporting & Analytics | | usnseomoz0 -
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 -
Domain Sub folder tracking from Google webmaster tool
I have created separate google webmaster access for this sub folder http://lineonebus.com/content/ Original domain http://lineonebus.com/ Search results in webmaster shows no search queries though this subfolder created in wordpress is ranking for some keywords.
Reporting & Analytics | | csfarnsworth1 -
What is best practice for tracking RSS feed subscribers
What is the most accurate/achievable way of tracking data about subscribers to your RSS feed through Google Analytics? With standard WordPress sites, we place the RSS link to Feedburner so we could track statistics. However it wouldn't track the way that I use it. I use Pulse on an Android Tablet to read my feeds offline on the bus each morning. At home, Pulse automatically downloads the latest feeds wirelessly overnight. So then I can read them without a connection. The obvious downside for my reading experience is that I only get what is contained in the feeds. If the company only includes an excerpt, it's too annoying to read the teaser and be unable to connect and follow a link. So I only subscribe to feeds that contain the full post. Yeah to seomoz, aimclear, SEL, adwordsblog. I dont subscribe to bruceclays blog, much as i'd like to, because it doesn't contain the full feed. That's probably deliberate on their part, because I have to consciously visit their blog on my desktop at work, to see the whole post. The other problem with say Pulse, is how it locates the feed. I typed in the URL, and Pulse subscribed me. I assume that Pulse simply looked for the domain.com/feed URL and added that, rather than look for feeds2.feedburner.com/domain. I looked at Feedburner stats and they didn't go up for 2 days, so basically it didn't track me. Would it be as simple as using the Google URL builder to add parameters to each post in the RSS feed? Eg utm_source=feedreader, utm_medium=rss, utm_campaign=tracking. But that still wouldn't track offline users. I assume that most people are also not going to paste the Feedburner URL into their FeedReader, but would let the platform auto-detect the feed. Any suggestions?
Reporting & Analytics | | ozgeekmum1 -
Best practices to track blog.mydomain.com in Google Analytics?
What is the best practice in Google Analytics? Tracking blog.mydomain.com + mydomain.com under the same profile? Or creating separate profiles for each blog.mydomain.com and mydomain.com? Thanks!
Reporting & Analytics | | gerardoH0 -
Should I delete a page that gets search traffic, that I don't care about?
I have a page on my site that consistently gets traffic, every month. Googlers seems to love it. But I don't like it at all. Webmaster tools shows that google allows us a certain number of search impressions each day. - it flatlines, they are limiting the impressions we get. We also getthe same number of clickthroughs each day. So my question is for anyone who has this same experience, who may have experimented by deleting a page you don't care about. Did you just lose that number of clicks each day or did other pages on your site get displayed and clicked through instead?
Reporting & Analytics | | loopyal0 -
Why is Benetton ranking with tracking parameters?
For this search: https://www.google.com/search?q=benetton&pws=0 I see the following URL ranking #1 http://www.benetton.com/?utm_source=centrum.sk&utm_medium=listing Why is this happening? I could likely figure it out but I'm busy so I was hoping someone could dig around and let me know 🙂 Anyone? Incidentally, Benetton is in the middle of a massive campaign at the moment so it's strange timing for them to have this showing up and screwing with their GA tracking... EDIT: I should clarify, Benetton is not a client - I don't know anyone who works for or with them. I'm just curious why this is showing up. cmNWx.png
Reporting & Analytics | | TomCritchlow1