Google Analytics user_id appended to links - google-analytics

Google Analytics now has UserID tracking to better track individual users across devices. Is it possible to add a tracking variable (like utm_campaign) specifying user_ID so that GA will associate those links with the user?
I'm looking for a solution that'll work even when the user isn't logged in (mainly for email link tracking).

No. Of course you can append the user id yourself and set it in your tracking code. But that would not uniquely identify a user (links get bookmarked or passed around e.g. when the email is forwareded to somebody) and someone else might end up with that id. The idea of the user id is that the CMS or CRM takes responsibilty for uniquely identifying users so we don't have to rely on the somewhat fragile client side mechanisms.
If you use it for email tracking it should IMO be enough if the user id is set in the first call of the tracking code if you have session unification enabled, so you'd just need to tag the link in the mail and read the id from there, without needing to persists the user id via the links. While I haven't tested this extensively the documentation seems clear on the point:
Session unification is a User ID setting that allows hits collected
before the User ID is assigned to be associated with the ID, so long
as those hits happen within the same session in which a specific ID
value is assigned for the first time.
Please note that the user id feature does not expose data for individual users via the interface, insofar the idea that it "better track[s] individual users" is not quite right (it will recognize users across devices but will still aggregate the data). If you want individual user you need to store the user id (or some other unique id) as custom dimension.

Related

Client ID and/or User ID - which to use?

Background of my specific environment: I am trying to set up GA to track the user journeys around an iOS native app written in React Native. The app is in-house only and all users consent to being tracked in this way.
As I understand it, the measurement protocol allows either Client ID (cid) or User ID (uid). In the docs, both are optional, but at least one is required. Makes sense so far. Client ID is an anonymous UUIDv4 that tracks a browser or device, but not necessarily a user. User ID on the other hand is some uniquely-identifying value for a user, but may cross devices/browsers.
Initially I wrote my application using cid (as I hadn't yet read the docs on uid). Every time a user logged in the user's uuid would be stored and sent as the cid parameter. I also used session control sc. This worked - I saw sessions coming in, the User Explorer showed me the individual user uuids and sessions, etc. But upon rereading the docs, this seemed like an incorrect use of cid. It seems like cid is meant to be consistent and not something that changes as you log in and out.
As people on my app can log in and out (and possibly will - staff members may well share devices), using a long-lasting cid that is specific to the device won't allow me to track the habits of individual users and changing it per login-session, as mentioned above, feels wrong.
So I switched out cid for uid. The docs say both are optional and one is only required if the other is not used, so I figured I could just use uid and use the user's uuid in that field and it's otherwise act the same.
However, when doing it this way no hits seems to be registered at all - in "real time data" as well as the User Explorer.
Am I doing something wrong or is this by design? (If by design, are the docs wrong to say cid and uid are both optional or am I reading it incorrectly?)
Either way, best-practices-wise, do I:
Just go back to using an ephemeral cid that only changes when people log in and out. Individual sessions in the app don't change the cid but I do use sc to explicitly start and end sessions by navigation inference (click 'home' = sc=end, navigate from 'home', sc=start).
Use uid as I am trying to (i.e. switching out the current cid for uid), but also include a random cid that never changes (regardless of session lifetime, logging in and out, etc.).
Something else?
I have seen this question and its answer but it does not really answer my actual question regarding how cid and uid should actually be used, and if my issue is me or the way that GA works.
Oki so client-id is randomly generated value and must be sent with all hits.
In a non-User-ID-enabled view, Client-ID is used to calculate unique users. In a User-ID-enabled view, User-ID is used to calculate unique users
In reference to your app, you can send the unique Device id value in place of random value for client-id. This will resolve all your problems and ensure that the client id is sent with all the hits, otherwise it wont get registered in GA

Google+ userId into google analytics for attribution modeling

Due to the nature of my website, it is very complex to get a proper attribution model, cross device tracking is complex but necessary.
I would like to know if it is possible to obtain somehow a users google+ userId whenever he visits my site.
I know there is a feature called UserId where I need to generate my own ID and track it upon a customers visit, but due to the nature of my website, there is very little probability they will log in prior to converting (Fact which will make every cross device interaction useless).
You cannot use a Google ID as the User ID in Google Analytics. The User ID must be private and non PII, i.e. Google must have no way to determine who that ID belongs to. Obviously if it's a Google-based ID, they would be able to tell pretty easily.
The relevant bit from the TOS is paragraph 7 :
You will not (and will not allow any third party to) use the Service
to track, collect or upload any data that personally identifies an
individual (such as a name, email address or billing information), or
other data which can be reasonably linked to such information by
Google.

Possible to use ecommerce tracking to track multiple users for a single transaction?

We're creating a flow for boarding new customers and would like to use the enhanced ecommerce tracking of universal analytics to track the boarding steps.
A single applicant fills in a form supplying information about their business and delivery addresses and such. The problem is that after the application has been submitted, the applicants need to electronically sign an agreement. There can be multiple people signing, and the person signing therefor doesn't necessarily need to be the same person that filled in the application. Is it possible to track a flow where another user/session takes over and finalizes the application?
If all participants in the application process sign in with a token - same token for all - you can set it as userID and enable session stitching - you'll need special userID view (and update your privacy policy) which will only show visits for which the userID was set and will recognize users across multiple computers, devices etc.
However this will still give you aggregated data only, so if you want to track individual users in addition to the flow you have to set the userID as a custom dimension (talk to your lawyer first, even with an anonymous ID profile building might be a privacy issue). The userID must contain nothing that would allow anybody but your own company to identify a specific user or device (no e-mail-addresses, no MAC addresses etc). Then you can pull the individual data with the custom dimension as key and match it with your CRM data.
No guarantees, but that seems the closest you can get to your requirements using GA.

Set an User ID afterwards

I was wondering, is it possible to set an User ID and track all the history of this user, even if it's not set since the first GA event ?
For example, if a visitor comes on my website, visits few pages... And then sets his email somewhere. I can send an event with a custom unique user ID, but is it possible to link this custom unique User ID with all the previous events ?
UserId must be sent with all hits from that user. The moment you start sending it Analytics can fill in previous hits within the same session, that requires that you use Session Unification ON. All future hits on the same session must have userId, session unification will fill in previous hits but not future hits without userId.
It's not possible to do a unification with past sessions either.
I highly recommend that you read through the Session Unification Help Center Article where this behavior is well documented.

Stop users entering my competitions more than once

I'm having a problem with my Facebook competition where users are entering multiple times. The required fields to enter are first name, last name and email. They can not enter the same email more than once, but they are just using different email addresses. I can not delete their entries however because there is no way to "prove" that it's the same person, even though it's dead obvious (exact same first and last name, all entries within 30 seconds of one another).
Our terms and conditions say that only one entry is allowed per person, per competition but apart from the email validation I can't find a way to enforce this.
When a user likes our page (which is required to enter the competition) is the ID of that user available from the signed request? Would it be within the Facebook guidelines to store this ID along with their entry details?
Thanks
no, you need to authorize the users then you get the Facebook ID.
You then can display a diffrent page as you know this user already taken part in the competition - so you dont give them the change to submit more than once for one Facebook ID.
as this will probably to late know, you can store a cookie. but be aware that users can delete this cookie.

Resources