1. Follow instructions in How to set up Google Search Console and verify your website.

  2. Follow instructions in How to set up Google OAuth Client config to get your OAuth config.

  3. Login to Matomo as Super User, click on “Administration (cog icon)” on the top right, and click on “Search Performance” under “System”. If you are using Matomo for WordPress, you first need to go to “WP Admin Dashboard -> Matomo Analytics -> Reporting” before completing these steps.

  4. Below Google Search Console, click Setup Configuration.

  5. Below Connect Google Account(s), click Start oAuth process.

  6. Now you can configure your websites to import Keywords for. Below Configure websites click the Add configuration.

Congratulations! You’re all set and your Google keywords will be imported in the new Matomo (Piwik) Search Keywords report.

How to set up Google Search Console and verify your website

To import your Google Search Keywords in Matomo, you need to sign in to the Google Search Console and check your website is verified. Follow the steps below:

  1. Sign in to Google Search Console (you may need to create an account). Google Search Console is a free service offered by Google that helps you monitor and maintain your site’s presence in Google Search results.

  2. In the Search Console home page, click the Add a property button and type the URL of the site for which you want keyword data.

  3. Click Continue to open the Site verification page. Select a verification method to prove that you own the site and follow the verification instructions on the page.

Once your website is verified: congratulations! You can now proceed to setting up the Google Search Keywords import in Matomo

How to set up Google OAuth Client config

Important note before we start: At no point during these steps will you be required to submit your ‘app’ to Google for verification. If you are prompted to submit your ‘app’ and do not have the option to click no or cancel, then please review the steps in this guide again to ensure that you have not missed an important step, or added additional information where not necessary.

If at any time you need to make changes to the OAuth Configuration, you will need to download the new OAuth Client credentials and upload them to Matomo in order for the changes to work.

Follow these steps to get your OAuth Client Config and use the Matomo Google Search Integration:

  1. Sign in to the Google API Console

  2. Click Select a project in the menu.

  3. To create a new project click the “New Project” button in the overlay:

  4. Give your new Project a useful name (for example Matomo Search Integration).

  5. After your project has been created, select it manually in the project list and click “open”.

  6. Click on Library in the menu on the left, then search for Google Search Console API, and click on the item Google Search Console API. Then on the description page of this API, click the Enable button.

  7. Next we need to setup the OAuth Consent Screen. Click on the Google logo at the top to get back to the dashboard, afterwards click on OAuth Consent Screen in the left menu. Select External and then click Create.

  8. Choose a name for your app, then click Add Domain and add the top level domain of your matomo instance e.g. matomo.cloud

  9. Select your email address from the drop down menu under User support email, and fill in your email address for Developer contact information
    Important note: Do not upload an App logo here, doing so will require you to submit your ‘app’ to Google for verification which can take several months to complete.

  10. Click Save and Continue and then click Add or Remove Scopes

  11. Select the “Google Search Console API” scope with the readonly property and click Update then click Save and Continue

  12. Next, we need to add Test Users in order to allow access to the Google Search Console API Scope.
    Click Add Users and enter the email address you will be using to access the Google Search Console Data.


  13. Click Back to Dashboard

  14. Go to the Credentials tab on the left menu

  15. Click Create Credentials

  16. Select OAuth Client ID

  17. Select Web Application as the Application Type

  18. Set a name for the application, for example Matomo at https://matomo.my-website.example

  19. Click on Add URI under Authorized JavaScript origins and set it to your Matomo URL domain for example: https://matomo.my-website.example
    Note: This needs to be a domain. If you have installed Matomo into a subdirectory, you need to enter the domain without the path. (so https://my-website.example in case of https://my-website.example/matomo/)

  20. Click on Add URI under Authorized redirect URIs. This needs to be set to your Matomo URL with this special URL/query /index.php?module=SearchEngineKeywordsPerformance&action=processAuthCode added at the end. For example: https://matomo.my-website.com/index.php?module=SearchEngineKeywordsPerformance&action=processAuthCode
    Note: the URLs above are HTTPS: we highly recommend you run your Matomo instance over SSL. If your Matomo doesn’t support https yet, you can replace the URL and use http.
    If you are using Matomo for WordPress: the URL must begin with the entire path to Matomo’s admin page, eg, http://mysite.com/wp-content/plugins/matomo/app/index.php?module=SearchEngineKeywordsPerformance&action=processAuthCode
    Note: that the URL for Matomo does not have to have a subdomain, that is just an example.

  21. Once you have entered the two URIs, click Create to finish creating the OAuth Client Credentials

  22. You will now be presented with the OAuth credentials that were just created, you can click Ok to close this dialog, and then download your OAuth client credentials by clicking the download icon on the credentials overview page. (Note: if you change any settings above at a later point for example to fix a typo in one of the values, you will need to download the OAuth client credentials again and re-upload it in Matomo.)

The steps in creating your OAuth Client Configuration are now complete. The ‘app’ that has been created during this process can remain as a ‘Testing’ or ‘Test Phase’ app without any need to submit it for review.
At no point during these steps would you have been required to submit your ‘app’ to Google for verification. If were prompted to submit your ‘app’ and did not have the option to click no or cancel, then please review the steps in this guide again to ensure that you have not missed an important step, or added additional information where not necessary.

You may still receive a warning from Google when completing the OAuth process saying “Google hasn’t verified this app”.
In this case, you can safely continue by clicking on “Advanced”, and then “Go to matomo.cloud (unsafe)” or “Go to yourdomain.com (unsafe)”

Congratulations! You can now proceed to setting up the Google Search Keywords import in Matomo