So there’s this nifty _trackPageview() api method on a tracker object, but is there a corresponding method that can be used to manually track a search? In other words, _trackPageview() reports to GA that a user hit a page. I want something like _trackSearch("terms") that would report to GA that a user searched for something.
So there’s this nifty _trackPageview() api method on a tracker object, but is there
Share
Though not exactly what I was looking for, it seems that one can generate virtual page views to track search results programatically.
Suppose that you’ve set up a Site Search parameter called “q”, so that when a URI is tracked that contains
q=these+are+some+terms, GA will mark it as a search hit. One can use the_trackPageview()method to generate virtual search hits like so: