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
-
Number of goals larger than the events its bases on - WTF?
Hi all We configured a standard goal in Analytics that is triggered on an event. I have seen cases where the number of triggered events is larger than the goal completions due to limitations to how many times the same goal can be fulfilled within the same session, BUT in this case we got the opposite problem. We got more Goal Completions than we got events that is supposed to trigger the goal. Now also added a screenshot of how the goal is configured. As you can see its just configured to use the Category name of the event. Nothing fancy at all. How can that be possible? Again, more goal completions than events that is suppose to trigger it? Grateful for any help Fredrik AclZDUO
Reporting & Analytics | | Resultify0 -
Why doesn't Google seem to care about referral spam?
In researching the issue of referral spam, there is no shortage if info, both on MOZ and beyond. But, neither the Google Analytics Blog or Help Forums seem to mention the issue at all. I'd think it is something that they would want to get rid of, yet it seems like they don't even acknowledge that it exists. Anyone have insights into this? Am I missing something, or is Google strangely silent on an issue that is becoming more and more annoying for anyone trying to use GA data?
Reporting & Analytics | | irapasternack1 -
Google Analytics Tracking Code Problems
I am having a problem with my Google Analytics tracking codes. The relevant GA tracking codes have been entered into the source code of certain sites I'm running campaigns on, but Google Analytics is still telling me that the tracking code hasn't been installed - yet it has. What could possibly be the problem here? I have checked that these sites don't run off multiple domains, and that the tracking code has been entered in the correct place within the source code - and yet I am still having problems with GA. Any suggestions?
Reporting & Analytics | | WebhouseISP0 -
GA E-Commerce can't tell the real order source?
I put the e-commerce tracking code on the transaction platform (Regnow) finishing page, but all the orders displayed in GA can't tell the real order source. Instead, most of orders are from direct(none), and referrals from my site. So this is obviously wrong. I need the accurate order source such as google organic or google ppc, then I can find which keyword brings me orders. After some searches, I guess the reason is cookie domain. My GA is set as single domain tracking. And I didn't put any cookie domain code on the Regnow's transaction finishing page. The codes I put on the page are: So, suppose my site is "www.example.com". How to make sure I can track the real order source on the Regnow's transaction finishing page? Should I set my GA to track multi top-level domains, and put _gaq.push(['_setDomainName', '']); code on the tracking page? How to set the domain name, "none" or "example.com"?? Thanks in advance.
Reporting & Analytics | | JonnyGreenwood0 -
URL Re-Structure - Tracking success of it
Hi guys, I was wondering what would be the best approach to track the success of a URL restructure? What we plan to do is to implement the URL re-structure slowly by only having it on new pages which go live for property listings. Any previous listings will use the old URL structure. I thought it would be best to limit any potential problems by testing it on a smaller number of pages. So my question really is, what metrics should I be looking at to determine the success of this given the fact that we remove any property listings once they get rented or sold?
Reporting & Analytics | | MarkScully0 -
Google News traffic spike mystery; referring URLs all blank, Omniture tags didn't fire.
Our content is occasionally featured in Google News. We recently have had two episodes where this happened, but (a) nearly all the referring URLs were blank, and (b) our backend logs show 3-4x more requests for the article in question than Omniture does. In other words, hundreds of thousands of visitors requested a URL from our site (as proven by the traffic logs), but don't seem to have come from Google News (because HTTP_REFERER was blank), and didn't execute the onpage javascript tag to notify Omniture of the pageview. Perhaps this has nothing to do with Google News, but it is too strong a coincidence that the two times we were on there recently, the same thing happened: big backend traffic spike that is not seen by Omniture. It is as if Google News causes browsers to pre-fetch our article without executing the javascript on the page. And without sending a referring URL. Has anyone else seen anything like this before? Stats from the recent episode:
Reporting & Analytics | | mcglynn
- 835,000 HTTP requests for the article URL (logged by our servers) - these requests came from 280,000 distinct IP addresses (70% US) - the #1 referring URL is blank. This accounts for 99.4% of requests. Which, in itself, is hard to believe. These people had to come from somewhere. I believe browsers don't pass HTTP_REFERER when you click from an SSL page to a non-SSL page, but I think Google News doesn't bounce users to SSL by default.That said, we do see other content pages with 70-90% blank referring URLs. Rarely 99+% though.0 -
Custom GA tracking and link value
Hi I'm working on a real estate agents web site which has a lots of links coming from paid listings in real estate linstings sites (this in France so I'm not sure examples will mean anything but basically the agents have 900 house listings in each site and each listing has a backlink) In analytics these are classified as referals and that's fine for the moment But because sites provide different types of links, we are considering tagging all paid links with analytics utm codes. Mainly to learn which ads are actually providing qualified traffic (providing contacts). I'm guessing that currently these links, there are thousands, bring seo value to my client's web site and are not considered as paid links. Will adding the analytics codes to these links cause a loss of their value by clearly indicating to Google that we paid for them? What's the current thinking on this? I'm tempted not to be worried about being honest about the origin of these links but I'm worried that there is a real danger of loosing current ranking Any arguments FOR tagging paid links ? Thanks for you help Neil
Reporting & Analytics | | NeilInFrance0 -
How do I set up Google Analytics to track paid visitors from Bing
When looking at Traffic Sources in Google Analytics, Google is broken out into paid and organic visits. I want to do the same with Bing. How do I do it?
Reporting & Analytics | | cpantages0