I'm currently trying to validate if a GA client ID is valid in realtime. I am currently using the userActivity search (passing in client ID) from Reporting API V4 and attempting to get results back (which would indicate that it is valid). However, I noticed that for a new GA client ID, it would take upwards to about 10-15 minutes before their client ID returns any results (same with the User Explorer on the web page).
Is there a way to validate a GA client ID in realtime?
Thanks.
Related
I'm using calendar API to pull events of users in an organization that had installed my GSuite app as a service account (it just means that I have access to all the users in the organization).
I noticed some weird behavior - let's say I have an event with 2 participants - a and b (both are users in the company). when I use the calendar API events.list to pull event for a I get this event, and b is listed in the attendee list with responseStatus of 'accepted'.
When I pull the events for the same period of time for user b, I do not get this meeting, nor when I try to pull a specific event using the meeting id (event.get API). I also used showDeleted=True but still didn't get the event back when pulling the events of b (I'm pretty sure if the event would have been deleted then the responseStatus would have been 'decline').
What could be the reason for this behavior? I tried to reproduce it using two emails that I have access to, and I was not successful.
Since those are emails of my client I cannot just come up to them and ask what happened with this meeting.
This is the request I'm making (using python google API client):
from googleapiclient.discovery import build as Build
service = Build("calendar", "v3", credentials=credentials, cache_discovery=False)
service.events().list(calendarId='primary', timeMin=min_time, timeMax=max_time, pageToken=page_token, singleEvents=True).execute()
First I'm building the service using the service account credentials (delegating permissions to the current email), and then making the request to pull the events.
The min_time,max_time are strings like this - 2020-10-19T08:00:00+0000.
The pageToken starts as None but will change if there is a nextPageToken in the response.
This is the request I made to try and get the meeting of the user that appear as an attendee when pulling the event using another user's email & credentials:
service.events().get(calendarId='primary', eventId=<meeting_id>).execute()
But I'm getting 404 event not found response (This API returns deleted events - I've seen it)
I'm pulling all of the events correctly, and only saw this case on small number of the events (less than 5% of the meetings).
Any idea what could cause this?
Thanks!
I see other posts saying that I can create a custom report in Google Analytics and use client ID as a dimension but I don't have client ID as a dimension even after setting up the User-ID View.
I'm tracking the usage of a Google Data Studio Report with Google Analytics and I can see data pulling through to the User Explorer but there's no Client ID field in the Custom Report Dimension drop down box. Do I need to set up something else?
First
Client id and user id are different identifiers.
Client id is a just randomly generated UUID v4 used in GA to identity visitors. It’s stored in _ga cookie so, I.e. if I’ll visit your site from 2 different browser there will be 2 different client ids.
User id is a field to store user id from your own authentication system. You can use it for cross platform and cross browser user tracking.
Second
Client id aren’t one of default dimensions in GA. To have it as a dimension you have to read it from _ga cookie or from model object and set it as a custom dimension.
I have implemented Google analytics reporting API v4 to get the data stored in Google analytics with one of the e-commerce applications and it sends two report requests to GA side in order to get data with pagination for the first request. one request is sent to get a page of userIds and second request will sent with those userIds to fetch another set of data. This works perfect until in some cases, at the last page it sends some userIds which is not showing in the Google Analytics web UI either. We have a record against each userId in our own database and there is no such record for those incorrect userIds either.
I would be grateful if someone has any idea/clue on this.
We have a Lead generation website, where conversion action is a form submit. A percentage of these leads get enrolled offline.
We plan to use measurement protocol to tie-back this revenue to google analytics.
The set-up is as follows:
Enable User-ID feature in Google Analytics
Sending the Unique ID generated by our CRM software as the User-ID in google analytics.
When one of the lead converts offline, we pass that information back to GA - and the associated UID shows the final conversion as well.
How do we proceed with step 3 and tie-back the revenue to the User-ID from transactions that happened offline?
As per explanation given in measurement protocol, only CID can be used to send the transaction values to GA.
Is it possible to do it using UID only?
Thanks
It is possible to send a UserID via the measurement protocol please see the following page for details:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
In essence you add &uid=USER_ID to your request URL
However you must also supply a ClientId, the usual approach would be to store the ClientID of the user against the user record in your database when they submit the form online, which you can then later use to reattach to the request you send via the measurement protocol.
To get the clientId from the form is simple
ga(function(tracker) {
var clientId = tracker.get('clientId');
});
https://developers.google.com/analytics/devguides/collection/analyticsjs/cookies-user-id#getting_the_client_id_from_the_cookie
I am sending an offline event to Google UA using their measurement protocol. I am trying to tie it to the users previous visits to get attribution and using Google's own Client ID from their cookie to do that. While the event does appear in Google UA, it is not tied to other client id sessions.
Here an example of the API call
In this example, "1859919454.1455744839" are the X.Y elements parsed from the _ga cookie's client id.
Am I doing something wrong or making some wrong assumptions about google analytics accepting their own Client ID instead of creating and using my own as suggested in their measurement protocol's parameter reference? I have seen plenty of forum threads that suggest google's own client id is acceptable.
I checked your API call and you are missing a measurement protocol parameter in the URL "t" (https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#t)
which defines what type of hit you are trying to send i.e. event or pageView
Google has created a debug tool to check whether the url generated is valid or not. You can also send hits to your GA using the tool.
https://ga-dev-tools.appspot.com/hit-builder/
turns out there is an unpublished parameter in the newer UA interface that allows for strict or loose userid. If strictly enforced, the userid MUST be a UUID. If strict is false it will accept google's own user id. Once that parameter is passed everything worked