How can I analyse search results in Google Analytics?

In this article you learn how to add Activate Search results to your Google Analytics dashboards.

Adding Search Queries to Google Analytics

To enable search tracking in Google Analytics 4 for your Spotler Activate Search integration, follow the steps below. This guide will help you configure your settings properly and ensure that search query data is tracked correctly in GA4.

Enable and copy your query parameter first

In order for Google Analytics 4 to log your Spotler Activate Search queries, you need to add Spotler Activate Search’s query parameter to Google Analytics 4. To configure the search query tracking correctly, you first need to copy the query parameter from your Spotler Activate account. The default query parameter is 'sqr', but it can be customized. You can find it in your Spotler Activate Search settings under Site Search > Advanced > Preferences > Google search query parameter
Google Analytics 1.png

Step 1: Access Google Analytics Admin Settings

In Google Analytics, go to the Admin tab.

Step 2: Select Data Stream

Under ‘Property’, go to Data Streams and select the website you want to track.

GA 2.png

Step 3: Configure Enhanced Measurement

Press Configure enhanced measurement.

GA3.png

Step 4: Set the Search Term Query Parameter

Click Show advanced settings at Site Search and adjust the Search Term Query Parameter to your query parameter ('sqr' by default).

GA4.png

Step 5: Save Your Settings

If you already have any query parameters set up, add your query parameter to the list and make sure to save the settings.

Enhance Search Analytics with GA4 Tracking in Spotler Activate Search

These steps are for the advanced GA4 users: Marketers, web developers, and professionals responsible for integrating Spotler Activate Search with Google Analytics 4 (GA4). These steps take around 10 minutes in total and you need:

  • A Spotler Activate Search Account
  • A GA4 property set up for your website
  • Basic understanding of JavaScript and event tracking
  • Important: A Google tag snippet installed on your website (i.e., the Google Tag for tracking)

Step 1: Locate Your Spotler Activate Search Tracking Script

Identify the script responsible for Spotler Activate Search tracking on your website. It is typically found within your website’s <head> section or implemented via Google Tag Manager.

Step 2: Add the GA4 Tracking Code to the Spotler Activate Search Tracking Script

Ensure you already have the gtag() function available on your website’s pages. This function is provided by the Google tag snippet mentioned in the prerequisites.

Paste the following code snippet inside the existing Spotler Activate Search tracking code (or within the Google Tag Manager setup if applicable):

Please note: The following lines should be added in the same place as the other _wssq.push functions.

If your snippet contains static.spotlersearch.com/sooqr.js use the following code:

_wssq.push(["suggest._bindEvent", "query", function(event, query, resultCount, queryId, queryIndex) { 
/* Custom Google Analytics tracking */ 
gtag("event", "search", {search_term: query, result_count: resultCount}); 
}]);

If your snippet contains static.sooqr.com/sooqr.js use the following code:

_wssq.push(["suggest._bindEvent", "trackQuery", function(event, query, resultCount, queryId, queryIndex) { 
/* Custom Google Analytics tracking */
gtag("event", "search", {search_term: query, result_count: resultCount});
}]);

Step 3: Test and Verify

Use your browser's developer console or a debugging tool to inspect network requests after performing a search on your website.

Look for events labeled "search" with the expected search terms and result counts being sent to GA4.

Refer to the GA4 DebugView to confirm events are being received and processed correctly.

Troubleshooting

If you encounter issues, double-check that the code is placed correctly within your tracking script (or Google Tag Manager setup).

Ensure the gtag() function is available on your website pages.