Learn business growth with Google Analytics 4 Forums Google Analytics 4 Implementing Website Search Tracking in GA4 with Google Tag Manager Reply To: Implementing Website Search Tracking in GA4 with Google Tag Manager

  • Ashton

    Member
    4 July 2023 at 10:40 pm

    Based on your question, it seems like you’ve set up everything correctly but aren’t seeing the search term value appear in Google Analytics 4. This is most likely an issue with the variable configuration in Google Tag Manager.

    In your variable settings in GTM, you’re trying to get the value of the parameter ‘tx_kesearch_pi1[sword]’. However, according to the URL example you provided, the parameter in the URL is ‘tx_kesearch_pi[sword]’. There seems to be an extra ‘1’ in your GTM variable. This could be why GTM isn’t able to retrieve the correct search term value.

    Please update your GTM variable and change ‘tx_kesearch_pi1[sword]’ to ‘tx_kesearch_pi[sword]’. Test it again to see if the search term is correctly being sent to Google Analytics 4.

    If you’re still having problems after making this change, please check if you’re properly capturing the variable value in both the Tag and the Trigger settings. There might be an error in your Regex configuration, too.

    Remember that GTM is sensitive to changes, so make sure all the configurations are identical to your webpage URLs, parameter names, and Regex settings.