Is there a limit to the number of calendar events that can be programmatically scheduled for a given user? - ruby

My web app has an event scheduling feature, and I'd like to automatically create, update, and delete calendar events from users' individual calendars as the event details change on my site.
My plan to do this is to set up an automated/service user (e.g. events#example.co) and use the Calendar API to send invites that come from that user. As the event gets updated I continue to use the API through that user (using a server-to-server authentication protocol, so no human authorization required) to modify the event and deliver updates
If I'm scheduling several thousand events - will this scale with just one user? It doesn't feel right to schedule so many events under one automated user. But then again, it might work just fine.
Is there a limit to how many events I can schedule?
Is there a more sane way to approach this overall?
Thanks!

The google calendar api applies some standard quota limits on you. Basically the number of requests that you can make. However when you are planing on using a single user then there will be some other rules you will need to consider
Copied from here
If a user has created more than 10,000 events in his or her calendar within a short period of time, that user might lose calendar edit access.
If a user creates more than 25 new calendars within a short period of time, that user's calendar might go into read-only mode.
In order to prevent spamming, Google Calendar limits the number of invitations a user can send to external guests. This limit varies depending on the action, and is usually between 100-300 guests.
You can do this using a service account. To my knowledge there is no limit to the number of events you can put in a calendar per day however as stated above there will be a limit to how many you can insert at once.
I am not aware of a more sane option than this sorry.

Related

How to be aware of the creation of a new event in a google calendar? [duplicate]

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

Track a Google Analytics event that occurs when a user isn't on the site

Our site enables users to send money to us via a bank transfer. They 'initiate' the transfer and get a reference code. Then they log in to their bank account and send the money using the reference code.
We track when a user promises to send the money but I'm not sure how to track when that money arrives. They won't be logged into the site when it happens which makes it complicated. Is there a way to do this?
Thanks in advance!
It is possible to track events on behalf of a recent user, but it requires coding on server side. You need to use the Google Analytics Measurement Protocol
to create this event, when you are notified about a successful transfer. You can send all relevant information to Google Analytics, like event category, action, or event value (e.g. transfer amount), or even track these as ecommerce transactions.
You can check the parameter reference to learn about the required and optional parameters to be sent with your hit. You can also experiment with such custom built hits with the Hit Builder tool.
If you would like this event to be connected to your existing user, then you'll also need to store your visitor's client ID during their visit, and later reuse this client ID in your backend-initiated Analytics hit.
Here is an example for an event hit for a recently stored ClientId, with given event attributes, including value.
There a few things to be considered in such scenarios, or at least to be aware of. Such events will generate additional hits in your Analytics property, and also initiate sessions, which can alter your various Analytics metrics, if their volume is comparable to your overall traffic.

Slack logon trigger

I want to create something in Slack that sends a message (starting by calling someone with '#') to a channel when specific users login. I've checked ifttt and zapier. I also checked the slack api to create something myself, but I couldn't really find anything usefull.
Anyone has any ideas?
Slack does not track user login or logoff in a traditional sense. Instead, users are always always "logged in" and available to receive messages once they have joined a team / channel.
There also is the concept of "presence", which is related, but not the same thing. User presence can change multiple times during a few minutes, e.g. if the user is on a mobile. I am guessing you would not want to send the user your message that often.
Still you can poll the presence information of a user with the API users.getPresence , which could be used to implement a script that polls this information on a regular basis and send your message. You also want to filter out presence changes below a certain duration threshold.
Keep in mind though that the rate limit for API methods is 1 per second. So depending on how many users you have in your workspace there will be a significant delay between the user becoming "present" and your script being able to send the message.
There is a workaround for that to have a google sheet as a database for the users and you can trigger by day once and timestamp it.
So the best trigger is a private message or public and you can use filter when mentioning or signin or signout it depends on the trigger word then you pass the filter since zapier won't count your zaps if you used fiter as a second step.

How does google calendar knows which events to include in sync?

I want to sync the events in my server side application with Google calendar events. I read about https://developers.google.com/google-apps/calendar/v3/sync but I'm not sure how it selects events? Are they per developer application or per user or per user or per user per calendar? or something else? If it is per user, is there any way to get all the changes for events created withmy application or associated with users of my application?

Google Calendar event Created/Updated/Deleted Webhook?

I am developing a SPA webapp through which I add events to my users google calendar They have given permission for. However this is my first time using Google calendar API, and was unclear about how to retrieve my users existing events , or if they add new events or delete them. IS there an option to set a webhook within google calendar thus when the user makes any changes to the calendar I can receive the change. My current approach was to make multiple get requests but that seems very inefficient. How can I keep my app calendar in sync with all user created events.
You can set up a push notification to be alerted any time anything changes on one of your calendars. I looked into it before a little, if memory serves it doesn't alert you to a lot of particularly useful information (I don't believe it tells you exactly what changed and how). Check out the docs here: https://developers.google.com/google-apps/calendar/v3/push
What I ended up doing was setting up a cronjob and getting all of my calendars' events using the synctoken, which returns only the events that have changed since the last time I polled the API for events. https://developers.google.com/google-apps/calendar/v3/sync
If you are using the SyncToken in your request for data, all you get back is the events that have changed. There is an eventID in the Google records that you can use to connect the change to your event data.

Resources