Google Analytics via Google Tag Manager

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Google Analytics via Google Tag Manager

This topic contains 4 replies, has 2 voices, and was last updated by

1 year, 10 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #26088


    How can I use Google Tag Manager to track Ajax searches in Google Analytics?

    The documentation describes how to use a Google Analytics script (outside of Google Tag Manager) to track ajax searches in Google Analytics. I was successfully using those instructions and getting search data logged as pageviews in Google Analytics.

    Here’s the code snippet that was working fine….

    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

    ga(‘create’, ‘UA-12345678-9’, ‘auto’);
    ga(‘send’, ‘pageview’);

    Then I switched all my scripts over to using Google Tag Manager instead of directly embedding them in the <head> section of the site.

    So Google Analytics is now using Google Tag Manager to do all its tracking, instead of a script directly embedded in the site’s <head> section.

    If I continue to use the code snippet (above) I would be “going around” Google Tag Manager rather that allowing Google Tag Manager to manage this script.

    How can I capture Ajax search terms as pageviews, but through Google Tag Manager rather than through a separate script embedded in the <head> section of the site?




    At the moment this is not possible, but the good new is, that version 4.18 is finishing the testing phrase on our demo site – which supports the GTAG integration method, and implement a more advanced events tracking feature, which looks like this, and results in this.

    This will be released within 3 days or sooner, all tests seem to be very promising. If it is okay for you, I suggest waiting for that, then you don’t need any duplicate code segments, the plugin should handle everything natively.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)



    Nice! Looks promising. I’ll stay tuned for the release. Thanks.



    Hey, I just noticed a new version (4.18) has been released. But when I click “update” I get an error message: “Update Failed: Plugin update failed.” I have the file from CodeCanyon if that helps. Does this release have the Google Tag Manager fix? And if so, how can I update to it? Thanks.



    Check the automatic updates guide, alternatively you can also update manually.

    Yes, this release have a complete analytics rework, you can read the new features here.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.