-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user grouping not working? #23
Comments
+1 same problem here, but afaict there are no cookies available from an API request right? I even tried setting gabba.ip(request.env['REMOTE_ADDR']) in order to get geo location but to no avail. TIA |
Yeah I'm guessing the only way to get that to work is if the user visits a site with GA tracking code on it from within the app, so they get the cookies set. But even then I'm unsure if the cookies would be shared with the application requests. The best mitigation I'd like to see for this is a way to tag users based on some unique identifier, like their access_token or something in the case of a REST api. Seems like it can be done myself, but I'm not familiar with the utm* variables so I'm not super excited about jumping in to a project like that. |
Thanks to your hint I somewhat solved sending two handcrafted cookies like these: __utma: "1.#{user_id}00000000.#{last_signin.to_i}.#{today.to_i}.#{today.to_i}.2" The utma cookie identifies the user using a combination from the second and third field so making these two predictable for every user I managed to group visits from a specific user while being able to identify new sessions (thanks to the last_signin timestamp). I then pass the two strings to the identify_user() before tracking. Now I even get geo location using the mobile analytics account identifier (MO-XXXX) instead of the regular UA-XXXX and passing the remote address of the request to the ip() method before tracking, as previously stated. Regards |
Cool, I hadn't noticed the MO- change, but looks like you are supposed to use that for all server side stuff. The "1." at the start is supposed to be a "domain hash" but I don't see how to generate the hash - Are you just using the value of "1." in all your requests and it works? |
I'm using the value I got from a real utma cookie (I've a web frontend that's tracking too) |
Hi,
I'm using Gabba to track usage of an iOS app with a Rails backend, but my GA dashboard is tracking every call as if it was a unique user.
Is there a way to identify my users (I could easily assign them a unique token to identify them).
My track code looks like this:
when I make multiple requests from one client, looking at the GA realtime dashboard shows the # of users increase with each request, even if it's the same request over and over from the same device.
Thanks!
The text was updated successfully, but these errors were encountered: