• Resolved Andrew

    (@schmitt)


    I would like to know if it is possible to implement user-id tracking in this plugin for sites with logged in WordPress users.

    The following line needs to be added to the script code:

    ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in user_id.

    Where USER_ID is the wordpress username currently logged in. This line would only appear if the user was logged in. I’d be happy to pay for the premium version to get this capability but it isn’t clear if this is one of the available dimensions.

    https://ww.wp.xz.cn/plugins/google-analytics-for-wordpress/

Viewing 7 replies - 1 through 7 (of 7 total)
  • yrjasz

    (@yrjasz)

    good question – do you support it? If someone does not have authentication system for the users? For example by tracking google accounts logins?

    thanks
    Dominik

    Plugin Author chriscct7

    (@chriscct7)

    We don’t currently have a custom dimension for user_id, but we’re going to be adding one for it when we release the next version of our custom dimensions settings for Pro

    -Chris

    yrjasz

    (@yrjasz)

    And will you include a way to assign a user_id for the website visitors or will it be something that webmaster will have to handle?

    -Dominik

    Thread Starter Andrew

    (@schmitt)

    That’s great news Chris. I’ve heard that Google doesn’t allow personal information to be tracked though. Might want to make sure this is in line with their restrictions.

    Here’s my use case. I have a subscription site for corporate customers. I’d like to track pageviews and downloads by corporate customer. My Usernames in WordPress have a unique string that identifies the corporate customer.

    Currently I use Woopra which is a little overkill. I am hoping GA can do this and I can set up a monthly report by corporation once this is in.

    Plugin Author chriscct7

    (@chriscct7)

    Let me allay those concerns.
    That would be section 7/8.1 of the terms (depending on which when you are reading) which reads

    > 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.

    Per Justin Cutroni an Analytics Evangelist at Google:

    > To add Google Analytics data to a data warehouse you need to add some type of primary key to Google Analytics. In most of the work that I’ve done this key is a visitor ID. This anonymous identifier usually comes from some other system like a CRM. […] I know what you’re thinking, “You can’t store personally identifiable information in Google Analytics!” But this isn’t personally identifiable information.

    Basically the definition of personally identifiable in this context doesn’t mean information that can be used by you to you figure out which user is which user but rather information that if a third-party looked at it would tell them which user is which user like an email or a name or their address. Therefore a WordPress user ID it is not a piece personally identifiable information.

    Indeed in Google’s documentation for Universal analytics personally identifiable is defined as:

    > personally identifiable information (PII) to Analytics (such as names, social security numbers, email addresses, or any similar data), or data that permanently identifies a particular device (such as a mobile phone’s unique device identifier if such an identifier cannot be reset).

    https://support.google.com/analytics/answer/2795983?hl=en

    Finally, on a documentation article for AdSense Google actually recommends sending a user ID in an example as an alternative to sending a users email. See
    https://support.google.com/adsense/answer/6156630?hl=en with the example of an email address in the URL and the corresponding solution section.

    > Solution: In most of these cases, the PII in the URL can be replaced with a unique site-specific identifier (background) or a UUID. For instance, site.com/settings/[email protected] could be changed to site.com/settings/43231, where 43231 is a number that uniquely identifies the account with address [email protected].

    In this case the UUID we want to use is the WordPress user ID.

    To answer yrjasz’s question WordPress automatically assigns logged in the user is a user ID which is a static number associated with their user account. We will automatically send this number if you choose to use this custom dimension.

    Thread Starter Andrew

    (@schmitt)

    I use emails as user ID’s (Profile Builder Pro plugin) so having the option to specify another meta field would be ideal.

    Plugin Author chriscct7

    (@chriscct7)

    When we’re talking about user ID’s, this is the numeric user ID assigned to each user by WordPress. For example, the first account created on your WordPress site (done during setup) has a user ID of 1. Each registration following that will have user ID 2, 3, 4 etc. The user ID is not the same as the username in WordPress (probably what you’re thinking of). There is no way to override the user ID in WordPress to have a non-numeric identifier (as the tables have an integer restriction in the installation SQL).

    The easiest way to view a person’s user ID, is you can go to their profile in the Users table, and while viewing their backend profile, the user ID will appear in the URL.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘User-ID Tracking Feature’ is closed to new replies.