I'm aware of the following methods of adding a Google Calendar:
- Show embedded calendar, hit the +Google Calendar button:
- Go to Calendar Settings.
- Copy the "Public URL to this calendar" such as
https://calendar.google.com/calendar/embed?src=foo%40example.com
. - When the user taps the link, they will see an embedded version of the calendar. They would then tap the bottom right +Google Calendar button and it'll be added to their calendar.
- Give the user the "Calendar ID" email address:
- Go to Calendar Settings.
- Under "Integrate calendar," copy the "Calendar ID" such as
en.christian.holiday@group.v.calendar.google.com
- The user would then open their Google Calendar, and under "Add a friend's calendar," they would enter that long email address.
- Add a shared resource:
- Hit the plus button near "Add a coworker's calendar"
- Hit "Browse resources"
- Add a calendar from the list
However, all of these methods are multi-step and less than ideal. I just noticed that there is a 3rd, more optimal way. There's an ability to create a link of the form https://calendar.google.com/calendar?cid=ZW4udXNhI2hvbGlkYXlAZ3JvdXAudi5jYWxlbmRhci5nb29nbGUuY29t
. Upon tapping on a link like that, it displays the calendar in the user's google calendar (or prompts them to add the calendar).
I tried substituting my "Calendar ID" in place of the "cid," e.g. https://calendar.google.com/calendar?cid=en.christian.holiday@group.v.calendar.google.com
but this produces an invalid link with the following error message:
Sorry
This email address isn't associated with an active Google Calendar account: en.christian.holiday@group.v.calendar.google.com. Please check the email address and try again.
Even if I try escaping the @
sign with %40
(https://calendar.google.com/calendar?cid=en.christian.holiday%40group.v.calendar.google.com
), I get the same error message.
How do I get my calendar's cid
so that others can add it with a single click on a link?
Best Answer
Update:
Normally you can just append your calendar id to the url:
https://calendar.google.com/calendar?cid=ht3jlfaac5lfd6263ulfh4tql8@group.calendar.google.com
However, there are times when this doesn't work and you're required to use base64 encoding:
https://calendar.google.com/calendar?cid=ZW4udXNhI2hvbGlkYXlAZ3JvdXAudi5jYWxlbmRhci5nb29nbGUuY29t
The exact rules for when one will work and the other won't seem fuzzy to me. This is a few things I found:
#
, unencoded id won't work, base64 will.@resource.calendar.google.com
), unencoded id works, base64 doesn't work.@group.calendar.google.com
), both unencoded and base64 work.@example.com
), both unencoded and base64 work.@group.v.calendar.google.com
), not sure which one will work as I've only seen these with the#
symbol which forces you to use base64.To create a single-click add to calendar link (if you are the calendar owner):
https://calendar.google.com/calendar?cid=bWFya2V0aW5nQHbWFya2V0aW5nQH
.To create a single-click add to calendar link (if you are not the calendar owner):
Prepend
https://calendar.google.com/calendar?cid=
to thecid
, and voila, you have a single-click add to calendar link.(Interestingly enough, the
cid
url will only work for a base64 encoded parameter even though the UI will show the unencoded email address in the error message.)To verify that the link works, assuming you don't want to remove the calendar:
Note: an alternative to figuring out the encoded
cid
, is to figure out where the +Google Calendar button (as part of option 1 in the question) takes you (e.g., via monitoring the network, or turning off your network and clicking the link).