Distinguish between http and https requests in Google Analytics - google-analytics

I have a site which (for legacy reasons) can be access with both http and https.
How do I see in Google Analytics how many users visit with each protocol?

You have to pass this information in a custom dimension (hit level), then you can use it in the reports.

Related

Google Analytics Offline tracking

I need to track information with Google analytics from within an intranet site and people consuming it may not have internet access.
Is there any way to do it?
One possible way would be to keep track of all events in an intranet server (the server that serves that intranet site could be an ideal one to do that), and then from that intranet server you can send HTTP request to google analytics i.e. proxy the analytics AJAX from clients to Google Analytics server
You can debug the request details using browser developer tools or else you can also try changing the URL of GA library source code to your intranet site that would proxy the request to google Analytics.

How does Google Analytics track referrals and direct links at the software level?

Google Analytics tracks the following acquisition types (ways in which its users reached your site):
Referrals
Search
Direct link
A direct link means entering a site name directly into the browser URL. A search means doing a google search and clicking on one of the results. A referral means someone clicked on a hyperlink which got them to your site.
It is obvious that since google search is run by google, clicking on a link in the google search results can submit the information of what clicked to the google analytic servers.
What is obvious is the other two cases (direct link and referrals). It seems to me that since these requests don't go through google, that google would have to own some software on interim TCP/IP routers for this to work.
So, my question is, how does Google Analytics manage to track referrals and direct links at the software level?
So, my question is, how does Google Analytics manage to track
referrals and direct links at the software level?
If there is no referrer (accessible via http headers) it's a direct type-in. If there is a referrer and it's not from a list of known search engines or social networks it's a referrer.
Since the referrer is accessible both via javascript (via document referrer) and via the http headers there is really not mystery here and they do not need to intercept traffic - source attribution works simply by way of exclusion (i.e. if it's not campaign traffic as per campaign parameters in the url it's a referrer or a direct visit).
In fact Google has a very nice flowchart to show how source attribution works. Once you realize that the referrer is public information (except for those user agent that choose not to send a referrer in the http headers) it's easy to understand how this works.

Google Analytics specific URL for any tracking code

As I understood, using Google Analytics, I can create a tracking code that I can embed into any application of website. However, is it receive a specific URL that is used for tracking the whole application in order for me to whitelist the traffic with my ISP so that I can charge the traffic for FREE for that specific URL - rather than whitelist the traffic of all google analytics (Which the ISP cannot do due to the heavy traffic generated by it) ?
You do not need to whitelist any traffic from your ISP. GA tracking works by collecting data from visitors to your site and has nothing to do with all other traffic on sites hosted by your ISP. As long as you have your tracking code on all of your own pages, then your site traffic will be tracked.

Google analytics tracking Http Https

I have a website with http and https access. (http://www.mywebsite.com, https://www.mywebsite.com)
Also, I have another website under https://www.mywebsite.com/myapplication
I need to set up Google analytics tracking for these websites.
Can I go along with a one tracking code?
Or do I have to get 3 tracking codes (as the analytics)?
Yes you can use one tracking code, the host doesn't matter, just make sure you're using Universal Analytics and not Classic Analytics.
The best test is to try it for yourself and see that you get hits correctly from both hosts.

track visits from nonbrowser application using google analytics

is it possible use google analytics to track visits from nonbrowser application? will ga be able to recognize custom user agents or other http headers? Anyone has experience in this area? thanks!
No. Only browsers execute Javascript, which is required for Google Analytics tracking. To track robots, you need to get server side logs. AWStats is a good tool for parsing Apache logs, allowing you to track robots and such.

Resources