Is it possible to use Google Analytics to track single user account? - google-analytics

I've got a website that needs user logged in before they can use, I want to track the behavior of each single user. Is it possible to do this? Any advice? Thanks very much!

Yes this is possible.
The simplest way might be to define a Custom Variable scoped to the visitor, and bind it to the value equal to the (obfuscated) user's ID (the one you assigned them when they registered):
pageTracker._setCustomVar(1, "Registered TempID", "345X34RT", 1)
The four arguments that you pass into a Custom Variable are: slot number (any integer 1 through 5, which won't change in this case; 'TempID' which is a variable name i chose for this variable; 'TempID', the value for that variable that maps to (but must not not personally identify or it will violate Google's Privacy Policy) a registered user; the final argument '1' is the scope, which i is '1' in this case because this variable is scoped to the visitor).
This new variable is sent to the GA server via a call to _trackPageview() so make sure you the custom variable is set before trackPageview() is called.
There are a several excellent resources, including step-by-step tutorials on GA Custom Variables, including a blog post by ROI Analytics, which is think is one of the best.
Once you've done to view this Custom Variable in the Google Analytics Web Client, go to the left-hand panel and click on the Visitor heading; the last item under this heading (and just before the next major heading which is Traffic Sources) you will see the Custom Variables subheading.
This is where you can view the data for the custom variables you set. For instance, the panel will look something like this:

It is technically possible, but prohibited by the terms of service that you agreed to when you installed Google Analytics (you read, them, right?).
From: http://www.google.com/analytics/tos.html
7. PRIVACY . You will not (and will not allow any third party to) use the Service to track or collect personally identifiable information of Internet users, nor will You (or will You allow any third party to) associate any data gathered from Your website(s) (or such third parties' website(s)) with any personally identifying information from any source as part of Your use (or such third parties' use) of the Service. You will have and abide by an appropriate privacy policy and will comply with all applicable laws relating to the collection of information from visitors to Your websites. You must post a privacy policy and that policy must provide notice of your use of a cookie that collects anonymous traffic data.
Seems pretty clear.

It's possible via User-ID javascript : User-ID j enables the analysis of groups of sessions, across devices, using a unique and persistent ID
ga('create', 'UA-XXXX-Y', 'auto');
ga('set', '&uid', {{ USER_ID }});
ga('send', 'pageview');
{{ USER_ID }} is a unique, persistent, and non-personally identifiable string ID that represents a user or signed-in account across devices.
https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id

The cookies that google analytics use, will track the same user, so long as they use the same PC and dont clear their cookies. Thats how GA can tell if a customer is a new user or a returning user. However, it is limited for the reasons I gave above.

Related

Google analytics track user behavior. Or possible?

I am searching for a way to track user behavior on my website. I want to know if it is possible to get a table with data looking something like this:
+------+---------------+-----------------+------+---------+
| time | ip or user_id | user_session_id | link | actions |
+------+---------------+-----------------+------+---------+
(Link - where user came from)
I want to track different user actions by sessions. Is this possible using Google Analytics or I should search other tools? My site is currently set up to track events but on my Analytics account I get only the number of events that occurred. I want to track what a specific user does on my site.
tl;dr: if you must do this use Mixpanel or similar software.
Time based dimensions are already available (date, hour, minutes and datetime). "link" would be referrer. Actions in Google Analytics are basically pageviews, events and transactions, so you have that, too.
IP and user id are a big no-gos. Storing anything that that identifies a person is a violation of Googles Terms of Service and depending on your location might be a violation of national laws.And if by user_id you mean the Google Analytics feature of the same name, Google says you may set it for logged in users and have to unset it for user that log out, so by extension that means storing it in Ga would probably be a violation of their TOS.
The GA session id is not exposed via the interface. You may read it from the cookie and store it in a custom dimension (I'm not sure if this is allowed within the TOS, on the other hand GA premium customers get this via a BigQuery export in any case, so it should be allowed).
If you simply want to tell different users apart you might simply generate a string in the UUID format and store that in a custom dimension. If you want to actually identify users (by name, adress etc), well, you are not allowed to and Google will terminate your account if they find out.
Not to mention that it completely eludes why so many people want to track individual users. You must not use GA information to target individuals, and simply looking at individual user paths will not help you (I wrote an article about that, although I do not expect that this will convince you).
Google Analytics is for technical and legal reasons not a good tool for tracking individual users, if you need to do this use a software that is made for this purpose. Mixpanel is often mentioned in that context but I'm sure there are many other solutions.

How to find adwords GCLID id in google analytics and link it to conversions manually?

I'm using a 3rd party tracking software (tracking202) to track conversions (as I can use the google conversion tag directly on my site, for some reason). Now, I've complete tracking data including keywords, placement and IPs of the converted users. Now, since Auto Tagging is enabled in my adwords account, google used glid id on my URLs since the beginning. I want to upload conversion data to adwords through the offline conversions import feature. And for that, I've 2 queries:
Where do I find the gclid ID in google analytics?
How do I link the converted IPs with GCLIDs ? (Since I have the converted IPs list in tracking202, if there's a way to filter IPs in google analytics and set the GCLID as the secondary dimension.. I would be able to collect the converted GCLIDs. But I'm not sure if its posisble in google anlaytics.
Please suggest what I can do in this case. Thanks a lot.
Google Analytics does not make the glcid accessible via the interface. If you want to get at the gclid you would have to store them yourself in a session scoped custom dimension (obviously this will not work for data already collected).
You need to create the custom dimension in the property settings (under "Custom Definitions") and then add a bit to your tracking code (poorly written PHP code for demonstration purposes only):
ga('create', 'UA-XXXX-Y', 'auto');
<?php if(isset($_GET['gclid'])) { ?>
// Set value for custom dimension at index 1.
ga('set', 'dimension1', $_GET['gclid']);
<?php } ?>
// Send the custom dimension value with a pageview hit.
ga('send', 'pageview');
i.e. "if there is a query string variable called glcid assign it's value to the custom dimension with the numeric index 1".
Technically the same works for the client IP address (which is likewise not displayed in the GA interface or exposed via the API). However you must not (as stipulated by the Google TOS) store information that allow to identify a user in Analytics (it might depend on your legislature if IP addresses are personally identifiable information. I don't know Googles stance on this, but it would be illegal in the Europe, at least without explicit consent of the user).
You may however store an anonymous identifier that allows to pull information from GA and connect it to information stored in other systems, so if you store e.g. the strongly hashed IP both in GA and in your other tracking system then you can use this as a key field to merge the records outside of GA.

Query Google Analytics by User ID

Is there a way to query results using the Core Reporting API (v3) and filtering those results by the User ID assuming that it is being sent to Google Analytics properly?
I've googled this question a lot and read a whole bunch of articles but I did not find one place that does that. Moreover, the fact that I cannot see the User ID anywhere in the reporting interface makes me doubt that this is even possible. I'm guessing I will have to dome something similar to what is recommended here in order to do it?
UPDATE
Apparently, the purpose of my question is not very clear as highlighted by Eike's comment below. What I want to do is generate a report for a specific user with a specific Id using the client API and then combine those results with information I have about this user in my system's database to do something as per my business requirements.
The best place to turn to for such questions is the Dimensions and Metrics Reference. If the dimension you're looking for is not there then you cannot query it or use it in a filter.
The list is really well maintained, so it's not very likely there are as-of-yet undocumented dimensions you could use.
User id is not there.
Well there is a way now.
The docs says the following steps
Set up User-ID in your account
Agree to the User-ID Policy
Read the User-ID Policy. Under I agree to the User-ID Policy, set the switch to ON. Agreeing to the policy enables the feature in your account.
Click Next Step.
2. Set up User-ID in your tracking code
After you enable User-ID by agreeing to the policy, you must implement User-ID in your tracking code.
To employ User-ID, you must be able to generate your own unique IDs, assign IDs to new users and consistently reassign the same IDs to returning users, and include these IDs in the data you send to Analytics.
In this step, you can see the line of code that you have to add to your Analytics tracking code:
ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in
user_id.
3. Create a User-ID reporting view
User-ID data can appear only in a dedicated User-ID view.
Click Create.
Enter a Reporting View Name.
You might want to include the term "User ID" in the name to help you remember that this is a special User-ID view.
Select a Reporting Time Zone.
Under Show User-ID Reports, set the switch to ON.
Click Create.
Related resources
https://support.google.com/analytics/answer/3123666?hl=en

can google analytics tell me http referrer for each specific goal conversion?

I have a website that allows people to create an account (that is the conversion I wish to track).
I wish to know where a specific person is coming from. I have google analytics installed and have set up the registration page as a goal, but the reporting tells me traffic sources as an aggregated pie chart. It doesn't report down to the user account level to say that 'person with email xyz' came from 'facebook' for example.
What custom variables or mark up would I need to add to GA to report at that detailed level, if that is at all possible?
Otherwise, I will just have to record the first http_referer in a cookie and stick it in a database during the registration process.
Any advice?
Firstly I must ask you, how actionable do you think it is to look at data at that granular of a level? Finding out what % of people who registered came from facebook or some other place is actionable, because it helps you do things like determine where to focus marketing efforts. But individual users? How is this actionable to you? (hint: it's not)
However, if you are still determined to know this, you should first note that it is against Google's ToS to record personally identifiable data both directly (recording the actual value in GA) or indirectly (e.g. - recording a unique id that you can use to tie to personal info stored within your own system). If this is something you don't want to risk, I suggest moving to another analytics tool that does not have this sort of thing in their ToS (e.g. Adobe SiteCatalyst, which costs money, or perhaps you may instead prefer to choose an "in-house" approach, like Piwik)
If you are still determined to follow through with this and hope not to get caught or whatever, Google Analytics doesn't record data like what info a visitor filled out in a form (like their email address) unless you populate that data in a custom field/dimension/metric/event to be sent along with the request. Usually you would populate this on the form "thank you" page (which is usually the same page you use as your goal url or goal event if you're popping and using an event for your goal). So you would populate the email address in one of those custom variables and then have it as a dimension to break down the http referrer by.

Is there any non-valid contents for a referer field?

I'd like to know the identities of users who come to my website by clicking on a link in my native application.
Could my app populate the referer field with a unique user ID?
Does the referer field have to be a valid URL?
Will Google Analytics handle a referer that isn't a URL?
I could mockup a URL like http://www.user.com/656 where 656 is the user ID.
Any caveats?
Good question. On one hand, i have remapped quite a few of these GA Fields (including Referral) and i have never had a problem. In addition, doing so is core functionality in GA (see below); in other words (as i am sure you know) GA actually provides its users with the templates (via Advanced Filters) to munge these Fields beyond recognition. )
On the other hand, i can think of one situation (only one actually) in which i believe Google would object and that's the case where the replacement information violates the GA Privacy Policy. In particular, displaying or storing or tracking via GA any personally identifiable information violates the Policy [italics are mine, not a quote from the GA Privacy Policy].
The actual definition from Google:
Personal information is information
that personally identifies you, such
as your name, email address or billing
information, or other data which can
be reasonably linked to such
information
Is a unique user ID, personally identifiable information? There is a difference between data intended to clearly distinguish one user from another, and data intended to identify each user. The distinction might depend on security--i.e., how easily could someone who had in their possession a list of your unique user IDs, discover the user identifies behind them?
Technically, the referrer header just specifies a URL. If you want to construct "fake" URLs, come up with a URI scheme specific to your application. Something like userid:656.

Resources