Calendars
Show events from one or more public Google Calendars in a Calendars tab on your trail system (Double Diamond and Star plans).
Calendars let you publish events, such as races, group rides, lessons and work days, alongside your trail conditions. TrailHUB reads events from public Google Calendars using the Google Calendar API, so any event tool that can sync to a Google Calendar can feed it. Visitors see a Calendars item in the navigation bar that opens a week list or month grid; clicking an event shows its time, location and description.
This feature is available on the Double Diamond and Star plans. The Calendars Settings button only appears for owners and administrators of trail systems on those plans. If you need help setting it up or integrating a different events system, contact support.
You will need:
- a Google Calendar API key from Google Cloud, locked to
https://trailhub.org - the Calendar ID of at least one Google Calendar that is shared publicly
#Create a Google Calendar API key
- Go to the Google Cloud Console. From the project menu select New project, name it (for example "TrailHUB Calendar") and create it.
- Open APIs & Services → Library, search for Google Calendar API and select Enable.
- Open APIs & Services → Credentials, select Create credentials → API key, then Edit (or Restrict key) on the new key.
- Under Application restrictions, choose Websites (HTTP referrers) and add
https://trailhub.org/*. This stops anyone else using your key. - Under API restrictions, choose Restrict key and tick Google Calendar API only.
- Save, then copy the key.
#Add the API key to TrailHUB
- Select Trail System Details in the navigation bar, then Calendars Settings.
- Paste the key into the API Key field.
- Select Save Settings.
#Make a Google Calendar public and get its ID
- Go to calendar.google.com. Next to Other calendars, select + → Create new calendar, name it and select Create calendar (or use an existing calendar).
- Open the calendar's Settings and sharing.
- Under Access permissions for events, tick Make available to public.
- Under Integrate calendar, copy the Calendar ID (it looks like an email address ending in
@group.calendar.google.com).
#Add the calendar to TrailHUB
- Select Trail System Details → Calendars Settings.
- Select Add Calendar.
- Enter a Calendar Title (shown as a coloured pill above the calendar), paste the Calendar ID, and pick a colour for this calendar's events with the colour picker.
- Select Save Settings.
- Repeat for each additional calendar. Select the red - button beside a calendar to remove it.
The Calendars menu item appears in the navigation bar as soon as at least one calendar is saved.
#Troubleshooting
- No events show. Check that the calendar is public, that the Calendar ID is exact, and that the API key's referrer restriction is
https://trailhub.org/*(not a misspelling). Changes to Google restrictions can take a few minutes to apply. - Events show the wrong language. The calendar follows the trail system's language setting in Trail System Settings.