Precise Geolocation reporting using Google Measurement API - google-analytics

I'm having issues with Google Measurement Api. I need to manually report ecommerce transactions to the analytics, and the only data i'm getting from the payment processor is Country Code (which is not precise enough for our analytics process) and IP address of person doing the purchase.
We've tried sending uip (User IP override) param but analytics ignores IP and does not extract the Geolocation from it.
We've tried using geoid, but as i said is not precise. We need city information too. I see that geoid can take integer as param which describes the precise location, but i don't know how to get to that number if only thing i have is IP address.
Any help or advice will be appreciated.

Which hit type do you use?
You must fulfill all mandatory fields of GA measurement protocol so the request could be accepted by GA.
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters

Related

Direct Channels in Google Analytics

Is it possible to see which of the users acquired through direct channels in Google Analytics came from directly typing in the url/emails not a part of a chain/were just unknown sources and categorized there? If anything, the last category is the most important for me to differentiate from.
If the channel is direct you cannot understand if it arrives i.e. by typing the url, from an email or from a bookmark. You need to use the UTM parameters in the URL to customize the traffic sources.
https://support.google.com/analytics/answer/1033867?hl=en

Get IP of visitor from google analytics

How can I get the IP of the visitor in my google analytics account?
The API of GA https://developers.google.com/apis-explorer/#p/analytics/v3/ provide many information about the location of the visitor such as city, country, etc.. all of them all derived by the IP, However I didn't find the way to get the IP.
Note : I am using the v3 API of GA.
No, GA does not expose the visitors IP anywhere (also in some jurisdictions - e.g. all of the European Union - IP is considered personally identifiable information and would not allowed to be stored unless anonymized by cutting of a part of it, which would probably defy your purpose). Generally, if things are not in the list of dimensions and metrics (and the BigQuery export schema for GA Premium accounts) then they are not available

Can't track E-Commerce shipping details using Google Analytics Measurement Protocol

I need to track E-Commerce data in my Google analytic account using measurement Protocol. In the request I need to send following data and those data need to be tracked in my account.
Billing City (utmtci)
Billing Region (utmtrg)
Billing Country (utmtco)
But when I tried to find the parameters for these using enter link description here I could not find any matching parameter. Please help if any one know whether I can track these using measurement protocol.
This has been discussed (but not yet answered) here - basically it seems those fields have been deprecated.
I do not see that spelled out in the documentation, but those field do not appear in the parameter reference, not in the API (via the query explorer) and not in the GA user interface. If stuff is not part of the documentation it's pretty safe to assume that it is not there.
You can create custom dimensions in your property settings and send the geo information there.

Can I anonymize IPs in Google Analytics and still track unique visitors?

I am most interested in an answer for Android, though it would be great to know if the answer is generalizable to websites, iOS, etc. Can I anonymize IPs (using setAnonymizeIp()) in Google Analytics and still track unique visitors? I understand Google Analytics uses cookies for websites, and so I thought it might be possible (or perhaps even automatic).
Yes. The only effect that the anonymizeIp function is that it instructs Google to remove the last octet of the IP address from it's logs.
So, if your user's IP is:
123.45.678.90
And you run this function, Google will store it as:
123.45.678.XX
The only practical effect is that this results in less accurate Geographic reporting, but that's it. It won't affect counts of unique visitors in any way, and is totally unrelated to how GA tracks unique visitors, since Google Analytics does not rely on IP addresses for unique visitor identification. For websites, maintaining unique user identification is done by the Google Analytics cookies. In this specific case, the Google Analytics Android SDK handles the user session management for you using a local storage mechanism analogous to cookies.
I dont know if the accepted answer is correct. I've enabled setAnonymizeIp myself on my app, and it had a huge effect on my analytics results.
Pages/visit shot up.
Visits halfed.
Avg time on site shot up.
Ip address is not the value used to identify a unique visitor/user on Google Analytics, so it shouldn't be an issue. Analytics uses a unique identifier in a cookie or mobile app data so attach to all of the user's hits in order to identify as a unique visitor, so I don't see a reason why ip masking should affect it.

Using Google Analytics to Track User Session

I have a PHP (5+) based website.
I want to track registered users of my site using Google Analytics. I basically just wish to grab their session id (or some way to identify each specific user)and view their movements and site usage from my Google Analytics dashboard.
Can this be done? If so, any guidance would be most welcome.
I believe the best way to do this is via a custom variable:
_setCustomVar(index, name, value, opt_scope)
It would be up to you to identify the 'value' as a unique session id for the user.
The scope in your case would be either session(2) or visitor(1) depending on how you want to track it.
http://code.google.com/intl/en/apis/analytics/docs/tracking/gaTrackingCustomVariables.html#setup
Technically you are able to store the username as a custom variable, but doing so violates the Google Analytics Terms of Service (ToS). Among other things, the (paraphrased) ToS states that you aren't allowed to store anything in Google Analytics that allows you to identify who the visitor is. This typically applies to usernames, IP addresses, phone numbers, etc.
If you decide to ignore the ToS and store the data anyway, it exposes YOU (not Google) to all kinds of data protection & PII laws. Especially in the EU.
If you have some budget money to work with, the best way to see the information you're looking for is to use an on premises web analytics software package that can process Google Analytics data. When you keep your data on premises, it alleviates many of the data privacy / protection / PII laws.

Resources