简体   繁体   中英

Google Analytics Site Search Tracking on Mobile Site

we are trying to track the search on one of our clients mobile site with google analytics site search tracking function but it just doesn't work. We do this by pushing virtual page views. We adjusted the search terms in the tracking code and in the view settings (searchparamter: search). On the normal website the site search tracking works just fine but on the mobile site it just won't function right. Both sites are in one property and only use filters to include/exclude mobile/website traffic. In the reportings of the mobile site search there is only very few data and all of our test keywords were not tracked.

When searching on the mobile site, the URL is output as: http://de.website.mobi/search.php?search=test

This is the code we use on the mobile site:

    (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','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-43881360-1');
    ga('set', 'anonymizeIp', true);

                ga('send', 'pageview'
                                , { 'page': '/search.php?search=test' }
                                        );

I'm really thankful for new ideas or general feedback! Thanks in advance!

You will need to:

  • Go to your google analytics admin panel
  • Go the view you want to track the site search under. Its the last column to the right
  • Click on "View Settings"
  • Click on "Site Search Settings" (bottom)
  • Turn it on
  • Type in search

Save it and it will work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM