Google Photos

Using Google Photos got a little bit more difficult. To connect to the Google Photos API you need to create a new project in the Google Developer console.

[Warning]Warning

For the free version there is a limit of 30 visible photos per album in the front end. Event Gallery Extended allows to show more than 30 photos per album.

Video - Setup Google Photos

https://youtu.be/EuFgChuPyvA

Steps to create the Google API Project
  1. Open the Google Developer Console (Google Developer Console) and sign in.

  2. Click the project selector in the top tool bar and create a new project

    Create and configure API project

  3. Fill in to new project form and hit the create button.

    Create and configure API project

  4. Now we need to enable the Photos Library API. Click the Enable APIs and Services button, search for the Photos Library API, click the tile and hit the Enable button.

    Open the library search

    Search for the Photos Library API

    Enable Photos Library API

  5. Open the credentials view by clicking in the left menu. If you don't see it, click on the GoogleAPIs-logo in the top tool bar.

    Back to the dashboard of the project

    Open the credentials view

  6. Now we need to create the credentials. Click the create credentials button and select OAuth client ID.

    Create OAuth Client ID credentials

  7. Before we can start creating the credentials we need to complete the consent screen. Click configure consent screen.

    Configure consent screen

    Configure consent screen

  8. The consent form asks your for a name of the application. Since only you will see this, it does not matter what you type in here. But the authorized domain is very important. Fill in your main domain and hit enter to submit it. You can add multiple public domains here. If you're finished, click the save button.

    Configure OAuth Client ID

  9. Now we're able to create the credentials. The type needs to be web application. Add a name for the credentials. Now add the Authorized JavaScript origins. Add as many URLs as you need. Start with your main domain and add something like https://www.svenbluege.de or https://svenbluege.de. Please note, that www.foo.com and foo.com are different origins! Then add your local test URLs as well. This can be something like http://localhost or http://eg.test. If you don't do this, you can't use those credentials on your local test environment!

  10. Now we have the credentials and need to add them in the Event Gallery configuration

    Save/remember/copy your credentials

Steps to configure Event Gallery
  1. First login to your backend and open the Google Photos Accounts-Section of Event Gallery. Hit the new-button. There you add your Google API Client ID and the Secret we collected in the previous step. After you entered the credentials, hit the save button.

    Google Photos Account Overview Page

    New Google Photos Account

  2. Now we need to configure the Refresh Token. Just click the Get Refresh Token button. A window will open. Click the Select your Google Account button. You will now switch to a Google window. You need to ignore the warning. Your API usage is not verified by Google so they warn you if a project tries to access photos. Go ahead and select your Google Account. The Refresh Token field is now filled in and you can save the configuration once again. If the Google window stays empty, please click the Select your Google Account button again without closing the empty Google window.

    Configure Refresh Token

    Expected security warning

  3. Done. You can start managing your Events/Albums now.

    Google Photos Account Page with the new account

Manage Event/Album
  1. On the Event edit page, you need to select the folder type Google Photos. An account selection drop down and a album selector button will appear. Select the Google Photos Account you want to use and click it to see your Google Photos albums.

    Select Google Photos Folder Type

  2. A list of albums for the selected Google Photos Account will appear. Now select one of the albums.

    Select Album

  3. Don't forget to publish this event and hit the save button and you're done.

    Select Album

Limitations

By default, the Google Photos API is limited to 10.000 requests per day. That might sound much, but it is not. Since every image URL in the response is valid for 60 minutes or less, Event Gallery needs to request album data multiple times per hour. Let us assume every 10 minutes. With ongoing traffic for 24 hours on your site, this is 144 requests per day. With 50 albums we're already at 7.200. So keep an eye on the API usage. If you reach the limit, no images will appear until the next day.

I noted that you can verify your project by Google. If I briefly read through the API policy, I see, that you should not create a clone of Google Photos. Well, it depends on how one thinks about your site, but getting the verification might get tricky. If you have other experiences, please let me know.

The image URLs Google delivers are only valid for 60 minutes. The number of API requests is limited. For every shared or sold image, a separate request is necessary to get the latest image URL. This might trigger the API limits.

Monitor your project

Alle Preise inkl. Mwst. , zzgl. Versand