I have a series of html pages that form a site that is installed locally on a customers machine. I would like to track their use of our site with analytics (googles or otherwise) to get a sense of where they are navigating, what they are looking at, etc.
I'm new to the concept of analytics on a webpage and want to know if there is a way to run these analytics on a local machine. Specifically, can this tracking information be accumulated locally on a customers machine and then uploaded with a separate application, i.e. it cannot be a requirement that these webpages have access to the internet. It would be ideal to create a dump or copy of the information accumulated that could then be sent off via another tool.
Thank you for all your help,
Dirk7589
NOTE:- Customer's machine must have internetconnectivity
You need to include analytics.js script in all html pages before closing of head tag, or while using framework like rails put it in your main template so it loads every time a user opens a new page.Also remember you need to send page view separately for ajax call.
USE THIS LINK FOR REFRENCE
Below code is analytics.js:-
<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
Then go to your google analytics ACCOUNT AND TRACK FLOW IN LEFT HAND SIDE
BEHAVIOR > BEHAVIOR FLOW
Related
Why are my Google Analytics Page Timings all 0.00%?
Is doing something like this enough to get page timings or is there something different I should be doing?
/* GOOGLE ANALYTICS ID */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', [myid], 'auto');
Other stats are working using same ga which I set to my account ID.
That's because of bounce rate.
When a visitor comes to your site, he or she gets a timestamp. So, Analytics might note that User landed on your Homepage at 17:35:03. Then, Analytics assigns a new timestamp when that user accesses a new page on your site. So if user clicks on a link to your About page at 17:36:04, that leaves your Homepage with a Time on Page of 00:01:01.
But what happens if user never accesses another page on your site (in other words, if bounces?
Then there's no second timestamp for Google to work from. So they assign a Time on Page of 00:00:00.
There are few workarounds.
One is explained here: tracking adjusted bounce rate.
I am struggling with this issue as well. After researching the page tracking site timings, it appears there could be a few issues causing the timings not be recorded:
GA Support
If you see Help in the PageSpeed Suggestions column, this indicates that we were unable to analyze the page at the given URL, and you should try again later. If the error persists, it may be due to any of the following:
-The hostname you have configured in the Website’s URL section of your View Settings is not a valid hostname for your website.
-The URLs shown in the Site Speed Suggestions report are not valid URLs for your website.
-You are tracking multiple subdomains and not using a single hostname.
-You have set up view filters to rewrite your URLs.
-The page requires authentication.
Most concerning to me is the "page requires authentication" item. I think that will prevent me from collecting this data.
I've got a site that has many domains and subdomains. They all go to the same pages and do the same stuff. The only thing that changes from domain to domain is the images and colors of the site. So I wanna track the users activity and started using google analytics. I changed the google script to this:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-X', 'auto', {'allowLinker': true});
ga('require', 'linker');
ga('linker:autoLink', ['domain2.com'] );
ga('send', 'pageview');
</script>
But this only gives me the data from all activities in the browser no matter from which domain it came. I wanna know if it's possible to also separate which domain had more hits and stuff like that. Is it possible? Is there any other tool where this is possible?
Thanks :)
Sounds like you are tracking all (and any) of your domains with that code snippet you provided. Some best practices are to
set up a view for each domain (with the appropriate Include filter applied) and also
set up a Roll-up view that contains data for all your domains, and you would definitely need an Prepend hostname filter so you can see which domain traffic comes in from.
set up a Raw view that is completely unfiltered,
and finally set up a Test view for testing out new configurations.
Edit: Here's a screenshot of how you would include a filter for a specific domain:
I'm breaking my nuts over this all day long.
I have a wordpress site i am trying to attach a GA account to.
I followed the instructions and pasted the code before
yet my status is still "Status: Tracking Not Installed"
and my real time dashboard shows nothing.
this is my code
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-21580912-7', 'auto');
ga('send', 'pageview');
</script>
this is my site www.nter.com
any help is good. ty.
Your tag looks fine after checking with Google Tag Assistant; I can see pageview hits going through. Are you making sure you are not filtering out your own visits? Also, the tracking code usually takes at least 24 hours to register, so if you just installed it then you would need to wait at least that long before seeing data show up in your standard reports (and also for the status to stop showing that tracking is not installed). In the Real-time reports, are you checking your own simultaneous visits, meaning you would need to visit your site, and then check right away in the RT reports? You also have an error on your page on line 169, which may or may not be breaking your analytics:
Uncaught SyntaxError: Unexpected token ;
I've deployed website that is running on server on local network and I would like to track traffic with Google analytics.
Following code, that was generated by google analytics, is placed in pages that I would like to track
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none'});
ga('send', 'pageview');
</script>
This line of code was modified according to this topic.
ga('create', 'UA-XXXX-Y', { 'cookieDomain': 'none'});
When I visit my admin page on Google analytics site it says under Status that Tracking is not installed.
Page was visited from several computers but it seems that page view info is not getting to Google servers.
Am I missing something?
Another way around would be to add a FQDN to your local /etc/hosts file, e.g.
127.0.0.1 localhost.dev
Point your browser to http://localhost.dev/ instead.
At the end it seemed that inserted code was enough. It just required some time for google servers to get and process the information.
I just generated the tracking code for a new Google Analytics account, and the domain I want to track is actually a subdomain. When setting up the account, I entered the subdomain as the URL I wanted to track, but I noticed when the tracking code was generated, it referenced the main domain and not the subdomain I had entered. Please see below, and please note that in the code below, I replaced the actual domain with "example.com". So, I have two questions related to this
I plan to insert this tracking code on my subdomain, but do I need to do anything special in the analytics settings to ensure that I only see stats for my subdomain and not the main domain? I don't have control over the main domain, and they don't have analytics installed on it.
If the person in charge of the main domain decides to install analytics on the main site, will my code affect his account in any way being that my tracking code references the main domain instead of my subdomain?
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46251874-1', 'example.com');
ga('send', 'pageview');
</script>
According to Google's analytics help, specifying the root domain in the way you have will allow you to track stats on subdomains. So no, it doesn't seem like you need to do anything special.
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingSite#domainSubDomains