AddSearch automatically detects Google Analytics (GA) on your website. We push statistics to GA automatically without you having to modify any settings in AddSearch. Google Analytics integration is available to professional plans (Professional, Premium, and Enterprise).

The only thing you need to do is to enable the statistics in Google Analytics. The steps to do this are as follows:

  1. Log in to your Google Analytics account
  2. Click on Admin, located in the upper right-hand corner.
  3. Click on View Settings
  4. Under Site Search Settings, turn on the button marked Site search Tracking. Input addsearch as the Query parameter, and check the box Strip query parameters out of URL. Then, input addsearch-category as the Category parameter, and check the box Strip query parameters out of URL. Click Save.

See the screenshot for the correct settings:
Google Analytics AddSearch setup


AddSearch reports three types of analytics information with a different Search category:

  • Result clicked: One or multiple of the search results got clicked
  • Results viewed: After typing a search query the results are viewed or scrolled through for a few seconds. This might or might not end up with a “Result clicked” event
  • No results: Search query returned no results at all. Nothing got clicked

Additional Notes

AddSearch is an instant search, and users of the search typically type one or two letters before clicking on a search result. This means that the top keywords in your GA statistics are typically very short and somewhat hard to decipher. We’re working on a solution for this.

See also:
How can I exclude AddSearch from my traffic numbers?

Global site tag (gtag.js)

If you’ve installed Google Analytics with the Global Site Tag (gtag.js) script, you need to add your Google Analytics tracking ID to the addsearch_settings JavaScript variable on your HTML template:

<!-- AddSearch settings --> 
window.addsearch_settings = {
 ga_tracking_id: 'UA-xxxxx-x' 

See the full documentation of the addsearch_settings variable for the search widget or for the results page.

Google Tag Manager

If you are serving Google Analytics as a Google Tag Manager (GTM) tag, some additional steps are required for Google Analytics integration to work.

Sign in to your GTM account.

Select “Variables” from the left-hand side menu

Under “User-Defined Variables”, click “NEW”.

Picture of user defined variables.

Create a variable “virtualPageURL”.

Picture of creating virtualPageURL variable

Click save. Click NEW again, and create another variable “virtualPageTitle”.

Picture of creating critualPageTitle variable.

See that both variables are created:

Picture of created variables.

Select “Triggers” from the left-hand side menu. Click NEW.

Create a custom event trigger on “VirtualPageview”.

Picture of creating custom event trigger on VirtualPageView.

Select Tags from the left-hand side menu, click NEW.

Edit your existing Universal Analytics tag, or create one if one doesn’t already exist. In the “Fields to set” section, add the two variables virtualPageURL and virtualPageTitle linked to the fields page and title. Add virtualPageview as a firing trigger.

Picture of GTA UA trigger.

Publish your changes, and the search events should start showing in your Google Analytics account.

Enabling Google Analytics integration in your installation

After setting up Google integration in your Google Analytics dashboard, follow the steps below to enable Google Analytics integration in your installation using the AddSearch Search Designer:

  1. Open the AddSearch Search Designer here
  2. Enter your site key in the Site key input field to have access to your search index
  3. Choose the Widget or Search Results Page to choose the search view
  4. Click the Advanced button to open the advanced settings
  5. Toggle the checkbox in the Google Analytics Integration row to enable Google Analytics tracking
  6. Add Google Tag Manager code snippet into Google tag manager the textfield
  7. Click Apply changes button to apply the changes

To get the installation script with Google Analytics enabled, follow these steps:

  1. Click the Installation Script button from the top right to open the search script
  2. Copy the script and add it to your website’s source code

Other Analytics Platforms

We have integrated with the leading open-source analytics platform Piwik in addition to Google Analytics. We support both self-hosted and cloud-hosted Piwik installations. See for more information. Please note that Piwik has changed its name to Matomo.

The third supported analytics platform is Adobe Analytics.

We are also able to fire custom analytics events if needed.

Was this helpful?

Need more help?

We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.