AddSearch detects Google Analytics (GA) on your website and pushes search events there. Google Analytics integration is available to Professional, Premium, and Enterprise plans. Depending on how you serve your analytics, you might need to configure it in the Google Analytics console only or in the Google Tag Manager as well.
Because AddSearch utilises search-as-you-type functionality, you need to disable the default Site search tracking in your Google analytics. Follow the instructions to do that:
If you are serving Google Analytics as a Google Tag Manager (GTM) tag, some additional steps are required for Google Analytics integration to work.
Set up variables
Sign in to your Google Tag Manager account
Click on Variables from the left-hand side menu
Under User-Defined Variables, click New
Click on the variable configuration and choose Data Layer Variable
Enter “search_or_click” under “Data Layer Variable Name”
Click Save and enter search_or_click as a name for the variable
Create two more variables, search_term and num_results, following the same steps. You should have three new variables once this step is finished.
Create a trigger
Sign in to your Google Tag Manager account
Click on Triggers from the left-hand side menu
Click on the New button
Click on the trigger configuration and choose Custom Event
Enter view_search_results under “Event name”
Click Save and enter view_search_results as a name for the trigger
Create a tag
Sign in to your Google Tag Manager account
Click on Tags from the left-hand side menu
Select the New option
Click on the trigger configuration and choose view_search_results trigger created in the previous step
Click on the tag configuration and select Google Analytics: GA4 Event
Open the Select Configuration Tag… menu and choose an existing tag or “Manually Set ID” if you don’t have any in the dropdown list
If you choose the “Manually Set ID” option, enter your GA4 Measurement ID that has the following format: G-XXXXXXXXXX
Enter view_search_results under the “Event name”
In the event parameters, you need to enter three previously created variables as shown in the screenshot
Then click Save and use view_search_results as the tag name
Publish your changes, and the search events should start showing in your Google Analytics account. Here is how the tag configuration should look like once the setup is complete:
Enabling Google Analytics integration in your installation
If you use legacy ready-made views, the integration will be enabled in your AddSearch installation by default. For contemporary out-of-the-box views, after setting up Google integration in your Google Analytics dashboard you need to follow the steps below to enable Google Analytics integration in your installation using the AddSearch Search Designer. In case you are not sure which view is installed on your website or you have a custom implementation, contact our support and we will be happy to help.
Enter your site key in the Site key input field to have access to your search index
Choose the Widget or Search Results Page to choose the search view
Click the Advanced button to open the advanced settings
Toggle the checkbox in the Google Analytics Integration row to enable Google Analytics tracking
Click Apply changes button to apply the changes
To get the installation script with Google Analytics enabled, follow these steps:
Click the Installation Script button from the top right to open the search script
Copy the script and add it to your website’s source code
Other Analytics Platforms
It is possible to integrate AddSearch with other platforms such as Adobe Analytics and Matomo (Piwik) using custom analytics events. Contact us at support@addsearch.com if you need help with the integration.
Was this helpful?
Let us know if you liked the post. That’s the only way we can improve.