Google Calendar API - recurring events instances are not fetched - google-calendar-api

I'm trying to fetch all events from a Google calendar using V3 API. I've noticed an issue regarding recurring events.
For some recurring events, on some calendars, only the first instances are fetched (for example - first 5 out of total of 8 instances are fetched).
Few additional details:
I've double checked that the query date-range is correct.
Problem occurred few times - for different Google Apps organizations.
Problem occurs also if I try to fetch the events from the calendar of the event creator.
We are using Google's python library for fetching.
Any inputs will be appreciated. Thanks!

You should set the "singleEvents" flag to True when calling the the API's 'list' command.
From the API documentation:
Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.

Related

Google Calendar Push Notifications: New events and event validation before/after creation

I would like to now if the following functionality is supported by google calendar api:
Does the functionality provided by "Push notifications" include new events or just existing ones. Here is a copy paste from the documentation that let me doubt that new event notifications are supported "The Google Calendar API provides push notifications that let you watch for changes to resources.". So does this only apply to already existing resources (events on my case).
Is there a way to limit the availability on the google calendar. By this I mean setting a general limit (i.e working hours for a company for example from 9am to 5pm). And putting the logic further, is there a way to add more constraints. For example after I receive a notification of a new event created (if this functionality is provided), I check the event's data in my web-hook and let google calendar know that this event shouldn't be considered as valid.
If these requirements are not provided already by google calendar API, I am open to any suggestions to accomplish this even if it takes more coding.
Just to make it clear. The context of these questions is when the user creates an event in their google calendar through google calendar web interface not through my application.

Saving statistics to Google Analytics

I'm relatively new to Google Analytics and would like to have some inputs.
So I have a web application that people can install to create a backup and can do restores as well. The application has an API where you can see the statistics of the app i.e. number of backups made, restores made, and the number of clusters connected to this application.
Now I want to send these stats to google analytics with an interval of 10 minutes. I was wondering if I can send the status to Event with a unique UUID as Event Category, the backup/restores, or nodes as Event Labels and the number as Event Actions.
Is this the right approach to using Google Analytics Events? Or is there a better way to do it in GA? My requirement is I have to do it in GA or should I use a different hit type.
Given that we are talking API's you intend to use the Measurement Protocol?
And the UUID refers to the unique user? if so, you should look at the uid https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
As to using Events versus Hits, using hits is probably easier on the reporting.

Google Calendar push notifications. Up to date flag

I've subscribed on google calendar push notifications (PN). Base synchronization processes using PN. I need to know if all events already loaded in calendar scope or not.
Is it possible to have a special marker in my request answer (request events for specified calendar based on subscribed channel information)?
If calendar has too much events, events will be loaded in few push notifications handling. I need marker for UI if calendar is synchronized completely. In my my usual logic I thought that calendar is already synchronized if first PN per calendar already handled. So I need notify my UI client with correct status (calendar_is_synchronnized, calendar_is_not_synchronnized) but I do not have any markers from google if the PN provides me load last events portion in specified calendar scope.
I haven't got elegant solution for my question. But I've solved issue with double call. The is no special API for this purpose, I've used algorithm:
after updating to sync token I try get all events for same calendar just to be able compare new nextSyncToken with current if it is the same.
if token is different if means the calendar sync is not completed yet.
If any better idea(s), you are welcome.

The API gives me identical resource-id for two different channels

I am using Google Calendar API and push notifications to add channels and watch those channels for new events that come in. However while tracking weird behavior with mixing calendar accounts and events I found out that the resource ID that the calendar API responded with is the same across two accounts.
I am not sure if this is the culprit yet but this is the definition of resource-ID from docs
X-Goog-Resource-ID - An opaque value that identifies the watched
resource. This ID is stable across API versions.
In my mind this means it should be unique. Resource-ID and channel-ID are a requirement for stopping channels after all.
Examples of identical resource-ID from google for two different accounts
Account 1
X-Goog-Resource-State: exists
X-Goog-Channel-Token: 56cab177e67348d9a17c7502a4bad513
X-Goog-Resource-ID: 8KXz6YKChAJDYMTUo0SoKqV8_7E
X-Goog-Channel-ID: ++7mlvx6pEIsTNeMpMwNLw==
Account 2
X-Goog-Resource-State: exists
X-Goog-Channel-Token: 4535832bc5cf47f7ae3403c404023bfd
X-Goog-Resource-ID: 8KXz6YKChAJDYMTUo0SoKqV8_7E
X-Goog-Channel-ID: mL+HzrG8/EYc7zRZdQ+6yw==
My question is, is this normal behaviour?
The push notifications channel does not provide updates on individual events. It only tells you when the calendar (collection of events) changed.
To find changes to events, you want to look up syncing.
With syncing, you send in a token you got from the last time you synced to the List API endpoint. Instead of listing all events, it will list only the ones that changed since your last since request, represented by the sync token.
You can POST to the List API any time you want to get changes to events, but the push notifications you described help tell you when there would be a meaningful change to call the sync.

Query Google Core Reporting API to get list of Google Analytics events in order they were sent out

I am writing an Android app and I am tracking some events through Google Analytics. Most of those events are interactions of the user with the app.
I am querying Google Core Reporting API to get detailed information about those events.
I am interested in finding out, for a particular session, the order in which the events happened. I have tried sorting the events by date, hour and minute, ("ga:date, ga:hour, ga:minute") but this is not good enough as some events happen within seconds of each other.
Is there any way I can get the list of events sorted by the order in which they were sent out?
Thank you very much.

Resources