adswerve / universal-analytics-python

Universal Analytics Python module
BSD 3-Clause "New" or "Revised" License
107 stars 41 forks source link

is it possible to 'identify' a user with this library? #17

Closed andrewljohnson closed 8 years ago

andrewljohnson commented 8 years ago

I was wondering if it's possible to do 'identify' similar to how you'd do it on iOS with this library:

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:kGAIUserId value:userId];

Any help is much appreciated!

samba commented 8 years ago

@andrewljohnson The tracker's constructor accepts a user_id parameter.

Example:

from UniversalAnalytics import Tracker
tracker = Tracker.create(ga_property_id, user_id="<user ident>")

(Though I'm the original author of this code, I'm no longer a maintainer. @LukaData may be the best contact going forward.)

andrewljohnson commented 8 years ago

Thanks, i did eventually figure that out :)