Automatically Subscribe all users to Super Admin Google Account - google-calendar-api

I need one super admin account to be able to view all Google calendars for all users in the organization.
To do this manually I would do the following:
Repeat for all users:
Using my super admin account go to https://calendar.google.com/calendar
Click on subscribe calendar and enter the email of the user
I want to automate this process using Google APIs.
Fetch all users in the organization
If I have not subscribed already then subscribe
Is it possible to do this via Google APIs? I was unable to find documentation on subscribe in Google Calendar API

You can add calendars to your super admin account from other users by using the method CalendarList: insert as this will add a specified calendar to your calendar list.
To get the calendar id required to insert this calendar into your calendar list you could use CalendarList: list and impersonating each user on your organization to then iterate over this list of calendars to get the id. I recommend doing this process using a service account.
Create a service account.
Iterate over each user on your organization.
On each user make a CalendarList: list call and iterate over each calendar of this list.
For each calendar use CalendarList: insert to insert this calendar in the super admin (or any other user) account.

Related

Google Cal API - Sending invites that insert calendar event automatically on attendees calendars

I'm using:
POST https://www.googleapis.com/calendar/v3/calendars/calendarId/events
To create and post a google calendar event on attendees calendars.
It worked when I was using my personal gmail account. However, when I switched to a Google workspace business account it did not auto insert the calendar invite on the attendees calendar.
I've checked permissions for both accounts, but I cannot figure out why it worked for my gmail during testing but won't operate the same with a Google workspace email. Example:
michael#gmail.com = it worked.
michael#google.com = it did not work.
Anyone experienced with adding g cal invites onto attendees calendars? Do I need an additional parameter like visibility when using this API?
Thank you !
I was able to try this and it succeeded using my personal gmail address as the calendarId. But when I changed the calendarId to a business account it failed. And the calendar invites did not automatically appear on attendees calendars like they did with my personal gmail account as the calendarId.

When do Firebase Analytics count a user as active?

I have an app where users need to sign-up in order to use it. The signup process can take up to a minute or so and eventually, it could fail, so the user doesn’t actually use the app.
My question is, how can I make Firebase count a user active, only after he/she has verified his/her account, so I can have proper retention analytics?
you can have a login page that when accessed triggers your analytics to report that a user has accessed the page in question, this way, you are able to track both app instances and logged-in users.
You can find the list of events and parameters here:
https://support.google.com/firebase/answer/7061705?hl=en

How to public secondary google calendar using Google Calendar API and Service account

I am having similar issues as this. My application is able to create a new calendar, with its calendarId qtg79cn1gs9ci7uge98is7pv6k#group.calendar.google.com.
However, I can't see anything in the Google Calendar web app (logged in with service account). I know that I have created a secondary calendar. How can I add it as an entry to the user's calendar list ?

Can Management API be used to create a Google Analytics Account?

Suppose that a user has a Google account (say a Gmail account), but he does Not have a Google Analytics account.
Can we have a 3rd party application use the Management API (when the user is willing to authenticate it via OAuth2 using his Google account) to reach the stage of creating Tracking Code ?
I am asking this because, in https://developers.google.com/analytics/devguides/config/mgmt/v3/mgmtReference/ , only 'list' is the method that is available for Accounts.
It doesn't appear that you can create a fresh GA account from the Management API. You can, however, list, create, edit, and delete users from an existing GA account:
User Permissions in the Management API allows you to list, create, edit, and delete users from your Google Analytics account. This is useful if you want to automate adding new users to Google Analytics, or removing a set of users.
User Permissions - Developer Guide
Add a Single User

Track google calendar subscriptions

Is there a way to actively tell which email addresses or google/iCal accounts have added/subscribed to a google calendar? I would like to keep track of how many and which email addresses use it or if they have unsubscribed. Currently, users can add the calendar either to their google calendar or their iCal. I own this calendar and have full access to its features should this be required.

Resources