Open navigation

How do i integrate Google analytics with Klevu search using Google tag manager?

Universal GA property is no longer processing new data and will be permanently deleted on Jul 1, 2024. If you haven’t completed migration, go to the Setup Assistant to get started with Google Analytics 4 (GA4). To maintain access to data from this property, you should download your data now. Learn more

This guide provides instructions for integrating Google Analytics with Klevu search using Google Tag Manager

This guide assumes that you're already set up with a GTM account and you have created a container for your store. If not, please follow the guide here to do so.

When you login into your GTM account, you will see a list of containers.  Select the container for which you want to integrate GA.

  1. Set up GTM Data Layer variable
    • Go to Variables -> User-Defined Variables  and then click on New 
    • Set up a variable for klevusearchterm 
    • You should now see the variable listed in the variables dashboard. 
  2. Set up GTM Virtual Pageview Trigger
    • Go to the Triggers tab and then click on New 
    • Create the trigger as a custom event 
  3. Set up GTM Virtual Pageview Tag
    • Now we need to configure a GTM tag, which is the link between GTM and Google Analytics so that the data can actually be logged.
    • If you don't have a GTM tag then
      • Go to Tags and then click on New 
      • Set the following details
        • Set the tag name
        • Choose Product: Select Google Analytics
        • Choose a Tag Type: Select Universal Analytics (or Classic if you’re still using it)
        • Configure Tag:
              • Insert your GA linking information (Tracking id)
              • Track Type: Page View
              • More settings -> Fields to set
              • page : {{klevusearchterm}}
        • If you already have other fields set in “Fields to set” section, just add a new field for “page” and set its value to {{klevusearchterm}}. Please note, if you do not see the "More Settings" option, select the "Enable overriding settings in this tag " checkbox.
        • Fire On: Select “track klevu terms” 

    • If you already have the tag for GA, please edit it as below: 
  4. Publish changes

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.