Google Search Console, a free tool by Google, helps you assess your website’s appearance in Google search results. It’s essential for all website owners as it provides insights for content and site structure improvements.
When integrated with Piwik PRO, Google Search Console data becomes part of your analytics reports. The combined data shows both search queries and clicked results, which helps you better understand how visitors from Google interact with your site.
In this article, we’ll show you how to set up the integration. While the process may seem a bit complex, follow our guidelines and integration will be done in no time.
Before you start
Here are some things to know before you start:
- You need to have the following permissions in Piwik PRO: owner or manage.
- You need access to Google Search Console and Google API Console. If you don’t use these tools, you might need help from your webmaster.
- The data from Google Search Console isn’t personal (PI) or identifiable (PII). It’s all aggregated and can’t be linked to individual visitors tracked by Piwik PRO. You can safely use this data and comply with data protection laws.
Add a property to Google Search Console
To start off, you need to add a property to your Google Search Console.If you don’t already have a Google Search Console account, you’ll need to create one first and then add the property.
To add a new property to Google Search Console, follow these steps:
- Log in to Google Search Console.
- Click the drop-down menu and click + Add property.
- Select the type of property: domain or URL prefix.
Tip: For more on property types, see this article.
- Check your property.
Tip: For more on checking properties, see this article.
- Done! Google begins collecting data as soon as you add the property, even before it is checked. However, you’ll need to wait a few days for the data to show up in Google Search Console.
Turn on the Google Search Console API
Once your property is all set up in Google Search Console, you can move to the next step: turning on an API. Piwik PRO needs API access to connect with Google Search Console and retrieve the data.
To turn on the Google Search Console API, simply follow these steps:
- Log in to Google API Console.
- Select a project from the project list or create a new one.
- On the left, click Library.
- Search for the Google Search Console API.
- Click Enable.
- Done!
Set up the oAuth 2.0 client in Google API Console
Okay, we’re halfway there. Now that you have your API ready, you need to set up the oAuth 2.0 client. The oAuth 2.0 is a protocol that allows Piwik PRO to access information from Google Search Console.
To set up the oAuth 2.0 client for Google Search Console API, follow these steps:
- Log in to Google API Console.
- Select your project from the project list
- On the left, click Credentials.
- Click + Create credentials, then pick OAuth client ID.
- If this is your first time creating a client ID, Google will ask you to set up the consent screen. Click Configure consent screen.
- In User type, choose External.
- Click Create.
- Add consent details that will appear on the consent screen:
- App name: Piwik PRO
- User support email: your email
- Application home page: https://piwik.pro
- Application privacy policy link: https://piwik.pro/privacy-policy/
- Application terms of service link: https://piwik.pro/cloud-sla/
- Authorized domain: piwik.pro (for cloud accounts) or your domain (for on-premises accounts)
- Developer contact information
- Click Save and continue.
- Click Add or remove scopes.
- Choose
../auth/webmasters.readonly
from the list or add scopes manually:https://www.googleapis.com/auth/webmasters.readonly
. - Click Update.
- Your scope is now added.
- Click Save and continue. You don’t need to set anything else, just follow the next steps.
- Click Back to dashboard.
- Click Publish app. If you don’t publish the app, its authentication token will expire in 7 days. This will deactivate your integration.
- Click Confirm.
- The OAuth consent screen is now public. It doesn’t require checking by Google because it uses a non-sensitive scope.
- On the left, click Credentials.
- Click + Create credentials, then pick OAuth client ID.
- Enter the following details:
- Application type: Web application
- Name: You can leave the name that Google suggested.
- Next, you’ll need to set up Authorized JavaScript origins and Authorized redirect URIs. You’ll find this information in Piwik PRO after following a few more steps.
- Log in to Piwik PRO.
- Go to Menu > Analytics.
- Navigate to Settings > Integrations.
- In Google Search Console, click Connect.
- On the setup screen, you’ll see information about Authorized JavaScript and Authorized redirect URIs. Copy these two addresses.
- Go back to Google Search Console.
- Paste the copied addresses and click Create.
- Once the oAuth Client ID is ready, click the download icon to download the JSON file. We’ll need it in the next step.
- Done!
Connect your Piwik PRO site with your Google Search Console property
Now that you’ve got your oAuth 2.0 client set up for the Google Search Console API, you’re ready to proceed with integrating it into Piwik PRO. It’s a quick and simple process from here.
To complete the final step and link your Piwik PRO site with your Google Search Console property, follow these steps:
- Go back to Piwik PRO and navigate back to the integration setup screen under Menu > Analytics > Settings > Integrations > Google Search Console.
- Click Next.
- Click Add file and upload the previously downloaded JSON file. Then click Next.
- Follow the confirmation screens from Google and click Allow.
- If you have multiple properties in Google Search Console, pick the one you want to link to your Piwik PRO site. Make sure that you select the correct one, otherwise your data will be incorrect.
- Click Finish.
- Bravo! The integration is all set and Piwik PRO will download data from Google Search Console up to the last 16 months. After that, Piwik PRO will update the data once a day. Just keep in mind that Google Search Console delivers data with a 3-day delay, so the data you see in reports will be a bit late.
Google Search Console report
Once your integration is ready, you’ll see your search data in the Google Search Console report in Piwik PRO.
To see data for Google Search Console report, follow these steps:
- Log in to Piwik PRO.
- Go to Menu > Analytics.
- Navigate to Reports.
- On the left, click Google Search Console.
Tip: For more on the Google Search Console report, see this article.
- Done!