We have a search box that displays results on Google Map embedded into the page. We use ajax async calls to the server to perform the search and then display the results back on the map without any redirect or change in the page url.
Is it possible to use Google Analytics' Site Search to track this? What would be the set up for that? Or is this not something that was meant to be tracked with Site Search feature at all?
Just a syntax update for Google Universal Analytics for the already great answer:
ga('send', 'pageview', '/mysite/?q=searchterm');
Lodge a virtual pageview (a trackPageview-call with a second parameter) in your ajax request with your search parameter as a get parameter in the virtual url (the name for the search parameter must be configured in the GA backend).
...(on ajax success)..:
_gaq.push(['_trackPageview','mysite/?q=searchterm']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With