Analytics

Find User of Analytic Tracking ID

It is not possible to search for user associated with an Analytics Tracking ID. But using the individual commands a Google Sheet can be created that will list all the DataStreams for all the users. This can then be searched for a specific Analytics Tracking ID (Measurement ID)

Create Google Sheet

Create a Google Sheet with 3 tabs, Accounts, Properties & DataStream. Record the following information;-

Commands

Populate the Accounts Tab with the users in the specifiec OU who are using Google Analytics. There may be multiple lines for the same user.

gam redirect csv - todrive tdfileid <File ID> tdretaintitle tdtimestamp false tdsheet id:<Accounts Tab ID> tdupdatesheet ou_and_children </Path/To/Top/OU> print analyticaccounts

Print the Properties for each of the user accounts from the Accounts Tab.

gam redirect csv - multiprocess todrive tdfileid <File ID> tdretaintitle tdtimestamp false tdsheet id:<Properties Tab ID> tdupdatesheet csv gsheet <File Owner Email> <File ID> id:<Accounts Tab ID> gam user ~User print analyticproperties Filter 'parent:~~name~~'

Print the DataStream info for all the Properties on the Properties Tab. This list can then be searched through for the Analytics Tracking ID to find the user and/or URL of the site.

gam redirect csv - multiprocess todrive tdfileid <File ID> tdretaintitle tdtimestamp false tdsheet id:<DataStream Tab ID> tdupdatesheet csv gsheet <File Owner Email> <File ID> id:<Properties Tab ID> gam user ~User print analyticdatastreams parent ~name

Print anAlyticaccounts

User

gam User <User Email Address> print analyticaccounts

OU

Print the Analytic Accounts for all the users in an OU and sub-OUs.

gam ou_and_children_ns </Path/To/Top/OU> print analyticaccounts

All Users

gam all users print analyticaccounts todrive

Print AnalyticAccountSummaries

User

This will show the properties/12xxxxxx90 for each of the different properties under each account for a user. The properties/12xxxxxx90 is needed in the analyticdatastreams command.

gam user <User Email Address> print analyticaccountsummaries todrive

Print AnalyticDataStreams

User

This command will display the Measurment ID (Analytic Tracking ID) and URL which may be useful.

gam user <User Email Address> print analyticdatastreams parent properties/12xxxxxx90 todrive

Show Analyticaccounts

User

gam User <User Email Address> show analyticaccounts

Show Analyticdatastreams

User

The properties/<Number> value can be found when running a [print|show] analyticaccounts command

gam user <User Email Address> show analyticdatastreams parent 'properties/<Number>'

Show Analyticproperties

User

The <Name> can be found after running a [print|show] analyticaccounts command. There are also other options to replace the parent but it appears that parent is the most common. The <Name> format will be similar to accounts/1234567.

gam user <User Email Address> show analyticproperties filter 'parent:<Name>'