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 Ernest Marcinko Ernest Marcinko 4 years, 1 month ago.

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

    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….

    <script>
    (function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,’script’,’https://www.google-analytics.com/analytics.js’,’ga’);

    ga(‘create’, ‘UA-12345678-9’, ‘auto’);
    ga(‘send’, ‘pageview’);
    </script>

    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?

    Thanks.

    #26096
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.

    Best,
    Ernest Marcinko

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


    #26116
    Chas9000c25
    Chas9000c25
    Participant

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

    #26152
    Chas9000c25
    Chas9000c25
    Participant

    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.

    #26160
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.

    Best,
    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.