Have you ever seen those event listings in the search results and wondered how you can get them? Do you organize events, either online or offline that you want to give extra exposure? Do you want to get more clicks, more visitors, more business by easily promoting your events?
Take a look at what we were able to do for our LocalSpark client Urban Air Trampoline Park. When you search for events in their city, their events show up in the search results:
Their event listings also show up on branded search terms:
Want to know how I did it? Read on for step-by-step instructions.
FREE implementation: Google to the rescue!
Depending on the platform you're using there are a number of solutions. In case you're using WordPress there are many plugins (both free and paid) to choose from, in order to get events in the search results. In most cases, you'll have to pay for solutions which connect to Google Calendar.
How about a FREE solution, using Google's own platform to generate the required code to import in your website to show the events from one or more Google Calendars?
To get Google Calendar events in the search results, follow these steps:
- Create (or assign) a Google Calendar, dedicated to your online events list.
- Open Google Script Editor and copy/paste the code from the bottom of this blog post.
- Run the Google Apps Script and grant the required privileges
- Get the public URL of your Calendar Script
- Import the content from the URL from the desired page(s) of your site and output it at the right place in the PHP code of the template within your CMS
Check out the video below to see how you can accomplish this for yourself, or follow the instructions underneath the video (HINT: watch the video fullscreen to see more detail):
This might sound more difficult than it actually is. Don't worry, let me take you through the steps, one step at a time.
Prerequisite: From here on, you need a Google account...
Step 1: Create a dedicated Google Calendar
Steps to create a new Google Calendar:
- Login to your Google account and go to https://calendar.google.com
- Click the little triangle next to “My calendars” in the left sidebar
- Click “Create new calendar”
- Give the calendar a name, set the correct location and timezone
- Click “Create calendar” button at the bottom when done
- Add one or more (dummy) events to the calendar so you're able to test it
Step 2: Create and modify the script
To copy the script, surf to https://script.google.com and perform these steps:
- Assign a name to your project
- Select and remove all code
- Copy the Calendar Events Google Apps Script (below) to the clipboard and paste it in the editor
- Get the calendar ID (see below) and paste it in place of the '#####' (5 hash tags / pound signs)
To get the Calendar ID or ID's, do the following:
- In Google Calendar, click the wheel on the right and select “Settings”
- Click on the top menu on “Calendars”
- Select the calendar you just created
- Copy the ID to the clipboard
Step 3: Grant the required privileges to the script
Your script can not be used, until you:
- Save the script by clicking on the little disk
- Select “doGet” in the “Select Function” dropdown box
- Click the “Play”-button
- Select “Continue” in the popup window, titled “Authorization required”
- When the next window pops up, asking to “Manage your calendars”, click “Allow”
Congratulations, you're almost there…
Step 4: Get the public URL of the script
Once you've granted the correct authorization and made sure the script doesn't return an error, follow these steps:
- Click “Publish” and select “Deploy as web app”
- Give an initial description
- Leave your Google ID under “Execute the app as:”
- Under “Who has access to the app:”, select “Anyone, even anonymous”
- Click on “Deploy”
You're then shown a window with the “Current web app URL”. Copy it to the clipboard and paste it in a new browser window. If you've performed all steps correctly, you'll see the events code, which you can embed in the source of your PHP template(s).
Step 5: Get the events in your PHP code
In order to get the events embedded in the source code of your HTML-code, you'll most likely need to modify the PHP template(s) of your CMS.
Since WordPress is the most widely used CMS, I only focus on WordPress from here on. But for any PHP-based CMS, the solution will be quite comparable..
Once you have the events listed on your screen in the previous step, create a custom field named “eventlisturl” in the page you want to have the events listed in the search results. Copy/paste the URL from your browser into this custom field.
NOTE: Make sure that you DO NOT USE the “Current web app URL” shown in the Google Script Editor, as this will NOT WORK!
Then in the template of your theme, add the following PHP code (typically in footer.php, just before
No comments:
Post a Comment