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.
Related
We allow our users to connect their Google Analytics account to our CMS. However, many of them choose to have us manage their GA, so we have a lot of properties.
Each property has its own View ID, and when we connect the View ID, we do so by entering the View ID. Then, the account select prompt shows up. We select the account that owns the property (which is usually the same account, say admin#company.com), and then retrieve access and refresh token.
This all works well. Except, sometimes it seems the refresh token invalidates.
Is this because of the refresh token limit (we definitely manage more than 25 clients)?
If so, what would be a better way to connect the property to the site, while still allowing users to use their own GA account if they wish to do so?
I was thinking of trying to retrieve which google account is being use for the connect, but I am not sure how I would do that.
Any ideas?
I figured it out. The refresh token limit is per actual google account, took me a while to figure that out. I now store a default value in the main DB and if that one can access the ID that is to be connected, the default is used. Otherwise it will redirect to the Google auth window and authenticate normally.
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.
I want to create a shopping cart with Meteor that allows non-logged in visitors to have persistent shopping carts.
As far as I can tell, the only way to track a non-logged in visitor in Meteor is to set a persistent ID on the client (localStorage) then pass that ID in every subscribe and method call.
Most web frameworks store a unique session ID in a cookie and that cookie is sent with every request to the server so the server always has a way to identify the visitor who sent the request - why not have similar functionality in Meteor?
It looks like Meteor persists the userId (if logged in) in localStorage and sends that userId to the server over the DDP connection - but that only helps when users are logged in. Why isn't this done with all visitors via a sessionId?
Am I missing something here? Other techniques are welcome - I just want to clean up my code and not have to pass the sessionId around everywhere.
You right meteor dont support cookies you can read more http://info.meteor.com/blog/session-cookies in here, my suggestion use local storage to persist clients without login. Also take a look to how to create UUID in javascript Create GUID / UUID in JavaScript?
//I commented first and post it here since I think this is the answer my two cents.
I'm guessing the cart is a field in your user collection schema.
Instead, make Cart its own collection and have userID be the foreign key.
Then, if the user isn't logged in, you can use the localStorage token as the ID: localStorage.getItem('Meteor.loginToken').
Finally, when the user signs up, in your createUser callback, you search for a cart with that token. If it exists, update it to the new userId.
This is also a little faster for analytics since you don't have to traverse the entire user collection to get the cart object.
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.
I have 2 custom variables in Google Analytics with scope set to 2(Session).
One variable tracks user role and other tracks user Program.
Our site works in a way that there would be a single role for different programs.
So a user can login with different roles.
If different users login in the same browser the custom variables values are overwritten.
For example the user logs in where role is 'Admin' and Program is 'ABC'.
The Google Analytics would show report
'Admin' 'ABC'
If the user logs off and logs in without closing the browser with role as 'Admin' program 'DEF' , the Analytics would now show report as
'Admin' 'DEF'. Thus 'ABC' gets replaced.
This does not happen if the user closes the browser and logs in again.
If user closes the browser and logs in again, I get report like
'Admin' 'ABC'
'Admin' 'DEF'
Is there a way to prevent overwriting even if the user does not close the browser?
The code is like:
_gaq.push(['_setCustomVar', 1, 'User Role', applicationRoleName, 2]); <br>
_gaq.push(['_setCustomVar', 3, 'Program Name', applicationProgramCode, 2]);
This is expected behavior. If the user logs out of your application and logs in again he is still in the same google analytics session. If he closes the browser he starts a new session, so you get two data sets with different values, one for each session.
So in effect you are asking "can I programmatically start a new tracking session in Google Analytics" to which to my best knowledge the anwser is no (at least not with methods provided by Google, of course you could change the Google cookie manually).
You might try to set setSessionCookieTimeout() to 100 milliseconds (or another ridiculously small value) specifically on your logout page so that sessions expire on logout immediately (and set it back to 0 - which means "session ends on browser close - on the following pages). However this is untested, not approved by Google, will change the way your data is collected and I would not recommend it.
Also my comment on the forced migration to universal analytics still applies.