Our scientists reserve time on 100 google calendars, which correspond to 100 scientific instruments at our laboratory. I display combined events for a scientist from all 100 calendars and display his/her events on a web page, so that the user can see at a glance upcoming reservations. I retrieve the users events from all 100 calendars by invoking EventsResource.CalendarService.Events.List(calendarId) per each calendar, but doing this 100 times is slow.
Is there a faster way to retrieve a particular user's events across multiple calendars without making a call-per-calendar as I do now? I realize I can embed the google calendar via iframe with multiple src's, but this UI calls for a tabular list and making a function call is more flexible than the embedded google iframe calendar.
If the user is creating the events, are the events showing on the user's calendar? If so, you can just retrieve events from the user's calendar, not each individual instrument calendar. If not, can you provide more details about how the events are being created, who owns them and who is invited?
Related
I have a use case to get the data of google calendar events from multiple accounts that are signed in by the user and show all these data in a single calendar. Is the possible by the APIs provided by Google?
The only way you could merge two users calendar data into a single calendar would be to read the calendar data from the first user and insert it into the single calendar one by one though the API using event.insert.
You would need to monitor these calendars all the time as if a user changes the calendar on their original account you would need to export that over to the single calendar, you could set up push notifications though and google would inform you when there are changes to events.
We have just linked our GA360 account to BigQuery but we noticed from the docs that the userId doesn't get exported. This is really annoying as one of our main use case was to join the userId with our CRM system.
Why is Google not exporting the userId ? Is there workaround ?
Thank you for your answers.
The solution is to create a User level custom dimension and pass your user's ID into that as well.
There's no restriction on exporting your custom dimensions, and these are exported to BigQuery.
Enjoy :)
How User-ID works
User-ID enables the association of one or more sessions (and the activity within those sessions) with a unique and persistent ID that you send to Analytics.
To implement User-ID, you must be able to generate your own unique IDs, consistently assign IDs to users, and include these IDs wherever you send data to Analytics.
For example, you could send the unique IDs generated by your own authentication system to Analytics as values for User-ID. Any engagement, like link clicks and page or screen navigation, that happen while a unique ID is assigned can be sent to Analytics and connected via User-ID.
In an Analytics implementation without the User-ID feature, a unique user is counted each time your content is accessed from a different device and each time there’s a new session. For example, a search on a phone one day, purchase on a laptop three days later, and request for customer service on a tablet a month after that are counted as three unique users in a standard Analytics implementation, even if all those actions took place while a user was signed in to an account. While you can collect data about each of those interactions and devices, you can’t determine their relevance to one another. You only see independent data points.
When you implement User-ID, you can identify related actions and devices and connect these seemingly independent data points. That same search on a phone, purchase on a laptop, and re-engagement on a tablet that previously looked like three unrelated actions on unrelated devices can now be understood as one user’s interactions with your business.
From Google analytics about the userid feature the user id is used in the background by google analytics to analyse your data.
If you want to analyse on the user id you can just add it as a custom dimension you will then be able to see it.
I need to track events in Google Analytics from a server through the Measurement Protocol. I can do this just fine, but my problem is that I want to send additional/custom data along with the event. Specifically, I want to send a UUID along with the event so that it is possible for me to fetch data from the Google Analytics API in the future and correlate events with rows in a relational database.
Is there any decent way to send custom data along with events? I looked at using the event value, but it must be an integer, and it is not intended for things like this. The event category, action, and label are reserved for other purposes.
I am not that proficient in Google Analytics, so the solutions off the top of my head would be:
Send an additional event containing the UUID in the event label or something like that. Seems like a bit of a hack/workaround to send two events, with one being used exclusively behind the scenes.
Perhaps using a custom dimension or metric. I am not 100% sure about the implications of this and if that's a decent approach or not.
So basically my question is: what would be the best way for me to send a UUID along with a Google Analytics event from a server, taking into consideration that I cannot use the event category, action, and label for the current event? Is there any other way in which I could link events retrieved from the Google Analytics API to rows in a database?
So let's say I trigger a "Completed Order" event to GA, and I also have orders in a MySQL database. So what I want to do, is to link an event to an order row in the database.
There are several things that you can do and it pretty much depends on what you want to do with the information you are storing. For starters, all your requests should include the uid field with the value being the user ID within your system. This way all Google Analytics data will be calculated on the same user. Note: this is an internal value used within Google Analytics and you won't be able to see it.
Second, I would create a custom dimension of the name user_id and store the user information in that. You will then be able to use this information within your reports to see what each user is doing. Note: it's against TOS to send user name, email, or any other PII (personally identifiable information) to Google Analytics. But you can send your internal user ID.
I have done both of these in the past and found it to work quite well.
More info on User-ID.
My app performs a one-way sync to Google Calendar. As in, if you create an event in my app it will be added to Google Calendar, but you can't update that event from Google Calendar.
I store all the Google Calendar IDs and Event IDs that their API gives me back so that I can update the calendars + events later.
However, I'm concerned about orphaned records. If, for example, someone deletes an event in my app but either the API request fails to delete the corresponding event from Google Calendar or my app has a bug in it, then that record will become orphaned -- it will exist on Google Calendar but I will have no reference to it.
So what's the best way to delete orphaned records?
Here are my ideas:
Download a list of every single event ID in Google Calendar, fetch all the event IDs out of my database, do a set subtraction to determine which ones are orphaned, and then delete those one-by-one.
Delete the entire calendar if I notice a mishap, and then re-sync all the events.
The problem with (1) is that it might get quite memory intensive once I've accumulated a lot of events. The problem with (2) is that a full re-sync can take awhile and those events will be missing from Google Calendar while the sync is happening. Plus, I might have a race-condition if users are creating new events during the sync.
What's the best approach? Are there any other solutions?
We use custom event tracking in our web application with Google Analytics to report user's behavior (for example - user clicks on key actions, client side errors, time measurements, etc.)
Each time the Google Analytics code is run on the client, we set a custom variable at the Visitor session to set the actual username of the user.
How do you use Google Analytics to report a table of all the custom events by visitor?
Our goal is to be able to have a storyline for each user, with all the events produced by the application correlated to its username.
There are no standard reporting views in Google Analytics that will give you this full view by default.
The best way to do this is with Custom Reports: Create a flat table custom report that has the custom variable value as a dimension, and the custom event dimension you're interested as another dimension. Then, set the metrics you want (total or unique event hits, presumably), and set the filter to filter down to the specific event category or action you want to view against.
Below I have an API recommendations (from a previous version of this answer) for how to pull this, but it would be roughly the same for creating a custom report.
Depending on your exact needs, the API call would be structured something like:
Metrics: ga:totalEvents
Dimensions: ga:customVarValue1,ga:eventCategory,ga:eventAction,ga:eventLabel
Filters: gaEventCategory==Foo