I use different ways to send events to Google Analytics on my website. Some user interface interations sends using ga.js but some user actions (eq.: succesful auth or transaction) is possible to send only from server-side (PHP) using measurment protocol.
Events are both successfully sent and come to GA, but there's no link between JS and PHP events. For example, user entered website, clicked some buttons (stats sent by JS) and made a transaction (stats sent by PHP). After that i see JS events linked to one session but PHP event isn't linked. It just displayed as separate event.
What information should i store and pass to measurment protocol to have that events linked?
You need to send the client id (as set in the ga cookie, because this is the key GA uses to group visits into sessions) and possibly the user ip override and user agent override.
Related
I have this scenario.
I have User-ID feature enabled in my GA with session unification ON.
Inside my app when user logging I push userId to dataLayer and then I publish the custom event.
Inside my "All View" I can see 2 users witch is good (since merging still did not happen) and inside my User-ID View I can see just user with set User-ID
Now, the thing I noticed is that when the custom event that is published from the client is showing in both Non UserID and UserID Views.
But when I publish Custom Event from the Server thru the API, With only passing User-ID That event is only showing inside User-ID View.
My question is is this expected? Or should I publish the Event from the Client directly through API with User-Id, or Session Unification will do the job and I'll only have 1 event showing instead of two, meaning that it will figure out that Event is actually associated to that specific User?
Thanks!
Seeing the endpoint you are using the problem is definitely due to the fact that you are sending only the uid parameter and not the cid as well.
In order for the hit to be successful, only one of the two uid or cid parameters can be sent, however by sending only the uid the hit will be shown only in the User-ID view.
My website sends usual Page views and events to GA using JavaScript API.
Days after user session, I need to send more data from server using Measurement Protocol.
After sending the nonInteractive hit with updated custom dimensions, I see that user's device category changed from the original device category (Desktop/Mobile/Tablet) to Desktop device category.
I understand that GA recognize server's User-Agent as Desktop device.
Is any way to make GA ignore server's User-Agent?
You can override the user agent by collecting the users user agent at the time which you are collecting their client id, and sending this user agent along with the measurement protocol hit with the key ua=.
For example:
v=1 // Version.
&tid=UA-XXXXX-Y // Tracking ID / Property ID.
&cid=555 // Anonymous Client ID.
&t=pageview // Pageview hit type.
&uip=1.2.3.4 // IP address override.
&ua=Opera/9.80 // User agent override.
For an overview see:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ua
For specific reference see:
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#ua
On this page, https://developers.google.com/analytics/solutions/crm-integration#summary-of-crm-data-integration-options-for-google-analytics ,
at the end of the table, for measure "Your Google Analytics profile based on user Id only shows activity for authenticated users". What does authenticated users mean in this case?
Ok I will try and clear this up. Normally when you send info to Google Analytics you use Cid think of it as a session id. So if I am on your website using chrome I get a session id and everything is sent using that cid. Then if for some dumb reason I start Internet Explorer well I get a different session id and am sending hits using a different cid. So Google analytics sees me as two different sessions.
Now if your website has a login function. I login and you send my login id as uid. Then for some unknown reason I start internet explore and login to your website again I have a user id. I am authenticated to your website and you send and the Uid for my activity both on chrome and internet explorer will be recorded as the same person.
First option logs as to separate sessions, second Google Analytics will detect that it is in fact the same person over several sessions.
The authenticated user is the users authentication or login on your website or application.
I'd use an ETL tool for combining the data from a Google Analytics account and a CRM software. The reason for doing that is so you can normalize the data.
The authentication is typically handled by the ETL vendor through API access key or OAuth log in.
There're a lot of tools that do this, Fivetran, Acho, Stitch and others.
I have a little web browser in my application that hits a webpage using Google analytics. That little web browser has cookies and local disk storage disabled.
Are my user analytics going to be skewed because of this? Is every user reported as a new user when in actuality they are an existing one?
Yes, your Analytics data is going to be impacted. For example, you will not be able to differentiate hits between Sessions and Returning Visitors. As you say, each Visitor will be reported as a new one.
Analytics uses the Client ID parameter to uniquely identify a Visitor. As the official Field Reference states:
Client ID
Required for all hit types.
Anonymously identifies a browser instance. By default, this value is
stored as part of the first-party analytics tracking cookie with a
two-year expiration.
If your application can generate a unique key for each user and persist it elsewhere that in cookies or localStorate, you could still create your own Client ID:
Disabling Cookies
By default, analytics.js uses a single cookie to persist a unique
client identifier across pages. In some cases you might want to use
your own storage mechanism and send data directly to Google Analytics
without the use of cookies.
You can disable analytics.js from setting cookies using the following:
ga('create', 'UA-XXXX-Y', {
'storage': 'none',
'clientId': '35009a79-1a05-49d7-b876-2b884d0f825b'
});
When you disable cookie storage, you will have to supply your own
clientId parameter except for the special case where you are using
cross-domain linking parameters.
Yes. Google Analytics uses the client ID to determine if a user is new or returning.
Note, if your users are logged in (probably not though without cookies), then you can use the user ID feature to determine new from returning users.
I created a google form as a work request form for my team at work. The request then goes to a google group (where all team members can access and pull from) The issue is when a request from the form comes to the google group it is showing that it was submitted by me and not by who is requesting the work, but when we go to the google spreadsheet to see the request it is showing the correct user who submitted.
How can I get the user (work email) who submitted to show in the google group?
Response to first comment-
Here is what a work request looks like coming into our group inbox (google group)
This is showing as being sent by Shaun, but I (Jessica) as in the second picture shows was the requester who filled out this work request
It appears that Shaun is the owner of the spreadsheet receiving the input from the google form, and/or the author of the script that generates an email from the form input and sends it to the google group. You don't say so explicitly, but I would guess that you're using a "Collaborative inbox" group type.
Since the email to the group comes from Shaun, that is the user profile that is displayed on the message, above the message content.
Possible options that fail:
While you can specify a different "from" address when sending an email via the GMail Google Apps Script service, you are limited to using your own registered aliases - so that isn't going to help you.
Instead of emailing the completed form, have the script generate the whole group entry on behalf of the Requestor (sic). Despite a 7-year-old feature request, there is no API that supports this.
So what will work?
If you're willing to forego the form and spreadsheet, each requester can send their own email, which will ensure that their credentials are used to display a user profile on the groups page. To guide use of standardized fields, you can provide a mailto link with the body of the email pre-formatted for users.
mailto:work-group#googlegroups.com?subject=Work+Request&body=Request+Type:+%0dProgram:+%0dWork+Package+Name:+
Such a mailto link can be embedded on a web page, or kept as a browser shortcut to make it easy on users.