Adding Events to a Google Calendar via a LinkPosted by Dylan Beattie on 12 January 2021 • permalink
It’s the 12th January 2021. Or the 43rd of December, 2020… or maybe the 317th of March, 2020? With so much of our lives being forced online, people all over the world working from home, it’s becoming harder than ever to keep track of what day it is and what’s happening.
I’m absolutely dependent on Google Calendar to keep track of what I’m doing – events, appointments, social calls, birthdays, even which day I need to put the bins out. I know I’m not the only person who does this, and so for a long time I’ve wanted a way to publish a link that will allow other people to trivially add an event to their own Google Calendar. This isn’t the same as actually sending an invitation – this is for things like meetups, live streamed performances; the kind of events where you’re not hugely concerned about whether a specific person can make it or not, but for folks who are interested, you want to help them remember that it’s happening.
Well, I found out recently that, through an undocumented feature of the Google Calendar platform, you can actually create a link that will do exactly this. And since it’s undocumented, I had to do a little digging to figure out the exact format of the URL you need to use.
First, the root URL:
https://calendar.google.com/calendar/u/0/r/eventedit. If you open that link without any query string parameters, it opens a blank “Add event” screen on Google Calendar.
Now for the query string parameters. These are the ones I’ve figured out so far; I suspect things like notifications and guests can probably be prefilled via the query string as well.
|name||description||Example / Comments|
||The one-line summary of the event.||
||The event start and finish times, in RFC 5545 date format, separated by a
||The longer event description. This field supports a subset of HTML, so you can include formatting, bullet points and links by URL-encoding your HTML code.||(see below)|
|location||The intended venue for the activity. This field correlates to the
||Google Calendar integrates this field with Google Maps, so entering something like “Zoom” will give you a handy link to the ZOOM+Care on Martin Luther King Blvd on Portland. Probably best to enter the URL again if it’s for an online event.|
||The recurrence pattern for recurring events, supplied as an
details field can include a URL-encoded HTML fragment, like this one:
%3Ch2%3EWe%27re+having+a+Zoom+party %3C/h2%3E%3Cul%3E%3Cli%3EVirtual%20backgrounds!%3C/li%3E %3Cli%3ESilly%20stories!%3C/li%3E%3Cli%3ESnacks!%3C/li%3E %3C/ul%3E%3Cp%3EYou%20can%20join%20it%20 %3Ca%20href=%22https://example.com/some/link%22%3Ehere%3C/a%3E%3C/p%3E
Putting it all together, you get a link that looks like this:
which looks unwieldly, but, hey, stick it behind some nice friendly text, and you’ve got your add to Google Calendar link ready to include in your event page.