Any way to specify the View ID to the tracking ID?

554 views Asked by At

Currently I have implemented google analytics in my app to track specific user views and events. It is set up so that anyone that logs in with a user ID can show up in my 'userIDview'. Since google analytics doesn't query user data I was trying to figure out a way around it. I was wondering if there is any way to assign a specific view to the trackingId? Say for instance I set up a view 'MaleUserID' so I could track all the userIDs for men and look at their data separately from women, but I also had a 'WomenUserID' so I could look at their data as well. I was wondering if there is a way to set the trackingId and view together like:

trackingId: 'UA-XXXXX-1.MaleUserID',

so that all of their data would go only to the 'MaleUserID' view and none would go to the 'WomanUserID' view.

That is a pretty simple example, in actuality I will need more than two because I plan on filtering it by the subdomains that the users sign in to.

1

There are 1 answers

1
Eike Pierstorff On

No.

Data is collected at the property level. Views are for displaying data. Specifying a view id would not make sense, since by default the same data goes into all the views. GA cannot separate data for you, you have to do it yourself via view filters.

If you want to have different types of data in different views you send all of the data to a property and then create view filters that separate data according to your criteria (which must refer to some data field that is send along in the GA tracking call). You cannot separate views at collection time.