If you are using Matomo On-Premise, first make sure you have the Search Engine Keywords Performance plugin.

  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. Upload the OAuth credentials.

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

  7. 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. After signing in, you can add a property from the option located in the top left.
    upload property GA
    You will then be presented with two options: ‘Domain‘ or ‘URL prefix‘.
    (If you have created a new account, you will instead be presented with the below options right away)

Domain: This option includes all subdomains (e.g., m., www.) and multiple protocols (e.g., http, https, ftp). It covers a broader scope of your website.
URL Prefix: This option includes only URLs with the specified prefix, including the protocol (e.g., http/https). It focuses on a specific subset of your website’s URLs.


Ga property

Choose the option that accurately reflects your website by entering either the domain or URL. Once you’ve made your selection, you will receive specific instructions on how to verify your chosen domain. The verification method will vary depending on the option you have chosen.

The verification process may involve adding a DNS record to your domain name or uploading an HTML file to your web hosting. Follow the provided instructions accordingly.

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 Menu icon next to the Google logo at the top and navigate to APIs & Services > 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 for both the Scopes and Test Users steps

  11. On the Summary step click Back to Dashboard

  12. On the dashboard, click Publish App under Publishing Status.

  13. Verify that the popup says “You do not need to submit your app for verification” and click Confirm

  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. Click on DOWNLOAD JSON to download the OAuth credentials.
    (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 (Go back to the top of this page to see the instructions).