Google Plugin

  • Google calendar plugin


    The Google calendar plugin integrates events from Google calendars into DPCalendar through a plugin. It is a two way sync plugin, means that you can manage (create/edit/delete) the Google events from within your Joomla site.

    The ONLY way to add make you Google calendars accessible in DPCalendar is to import them, because the Google API requires a refresh token. To be able to import the calendars you need to get first a client id and client secret string from the Google developer console.

    Client ID and Client Secret

    To be able to import your Google calendars you need a client ID and client secret from the Google developer console. This credentials are used to make authenticated requests against the google API endpoint. It is OAuth authentication and allows you to revoke the credentials at any time without exposing your private username and password.

    1. Select in the top bar a project, when you open the console the first time, Google creates an initial "API Project" for you automatically. Then click on the "Enable API's And Services" link. Google create API project
    2. You will get redirected to the API search page. Search for calendar and click on the Google Calendar API result. Now a page comes up where you can activate by clicking on the "Enable" link. Google enable API
    3. If you click again on APIs, then you should see in the Enabled APIs tab the Calendar API. In the left toolbar click now on Credentials. Google API list
    4. If you haven't set the consent screen on the API project, then Google tells you to do that. After you have selected the E-Mail address you have to define a Product name and the click on Save. It is recommended that the Product name is the same name as your Project name. Google will forward you back to the screen where you have to create the new Client ID. Google API consent screen
    5. Click on the credentials tab. Click now on the Create credentials button and then on the OAuth client ID list item. Now you are going to create the actual credentials which will be used then later for the import. Google API credentials
    6. You have to select Web application and put into the authorized Javascript origins your web site url. You have to make sure to set http or https correctly, if your web site doesn't have a valid certificate for https traffic use http. In the Authorized Redirect Uri field you have to put an url with the following parameters: Replace with your web site url. This url is important, if it is wrong you can't import your calendars, you will get a redirect_uri_mismatch error! Google API client settings

    Import the Google Calendars

    1. Click on the import button in the plugin edit form.
    2. Copy paste the Client ID and Client Secret from the google developer console to the form. Make sure you are logged in with the Google account you want to import the calendars, otherwise you will get an error like "Could not json decode the token"!
    3. Click the "Import" button.
    4. Accept the permission questions from Google.
    5. The Google calendars should be imported into the DPCalendar Google plugin.
    Google API client settings


    The Google calendar API does support attachments. But only if they are stored on Google Drive. The attachments are rendered in a separate layout in the folder /plugins/dpcalendar/tmpl/attachments.php. If you want to change that, then you need to copy it to /templates/{your template}/html/plg_dpcalendar_google/attachments.php and change it to your needs.


    • 400 Error: redirect_uri_mismatch
      This happens when the Authorized JavaScript origins or Authorized redirect URIs values are incorrect and do not match your web site. Keep in mind also the protocol (http/s) and the port do need to be correct.
    • Times are not correct
      When the times of the Google events are incorrectly displayed, then the cause is mostly that the Joomla timezone is not the same as on your Google calendar. Double check that both timezones are the same.
    • Error too many characters in description
      When editing an event, Google does only allow up to 8912 characters as description.
    • Import with an IP
      When you want to import your Google calendars on a server with an IP address, this happens mostly when you are testing it on a dev server, then things get a bit complicated. This due the fact that Google accepts only uris as restriction parameters. What DPCalendar does when you are working on a IP address it uses localhost. So you have to use localhost in your restrictions uris instead of your IP. After the authentication in the import process you get then redirected back to localhost. In your browser replace then localhost with the IP address of your server in the url bar and the calendars should then import form Google.
    • 403 Error with forbidden screen on import
      A firewall rule is interfering here. If you have a security extension installed like Admin Tools check their settings. If your hoster has a web firewall active, contact them and check if they can add a rule to allow these requests. In mod security, there is a rule with the number 336141 which should be disabled.

    Calendar Options

    These settings are the same for every calendar configured in the plugin.

    Calendar ID [Type: Text]
    Usually an email address like
    Refresh token [Type: Text]
    The refresh token is used to authenticate against Google.
    Client ID [Type: Text]
    The client ID from the Google developer console to authenticate. Please check the documentation for more information.
    Client secret [Type: Text]
    The client secret Google developer console to authenticate. Please check the documentation for more information.
    Format Description [Type: Radio] [Default: Yes]
    Should the description of the events being formated or should it be left as it is (should be disabled when you have plain HTML descriptions).
    The following options are available:
    1. Yes
    2. No

    Plugin Options

    Caching [Type: List] [Default: Joomla]
    Select whether to cache the calendar data.
    The following options are available:
    1. Joomla
    2. Database
    3. Never
    Cache Time [Type: Text] [Default: 900]
    The time for the cache in sec.
    Sync Start [Type: Text] [Default: -3 year]
    The relative start date to sync from.
    Sync End [Type: Text] [Default: +3 year]
    The relative end date to sync from.
    Sync Steps [Type: Text] [Default: 1 year]
    The sync steps.

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.