Thanks for your response, Dave!!! I turned on Site Search Tracking, as you describe, prior to your response. I had listed highlight and q (like this: highlight, q) in the Query Parameter field. But, based on other posts on the forum, I was under the impression that we also needed to include a section of script similar to this in the head section of my master pages:
(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-142461875-2','
http://serviceconnect.support.cdk.com/h ... efault.htm'); ga('send', 'pageview');)(window,document,'script','//
www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXXXXX','
http://XXXXXXXXX.htm'); ga('send', 'pageview');
$(document).ready(function(){
$('div.search-submit').click(function(){
ga('send','event','Search','Search',document.getElementById('search-field').value);
});
$('input.search-field').keypress(function(event) {
if (event.keyCode == 13) {
ga('send','event','Search','Search',document.getElementById('search-field').value);
}
});
});
A few questions:
-- Is this extra code not necessary?
-- If it is necessary, does this code seem correct? I found this on the forum. Madcap Support helped me tweak it to accommodate some changes in Google's code.
Thanks MUCH in advance,
Rich
Dave Lee wrote:richardc66 wrote:The Mike Kelley blog posting detailing how/where/what script to add to enable search-term tracking no longer appears to be available online. Does anyone have a current version of the script that I can add to the head section of my master pages?
It isn't actually a script, you just use the Site Search feature that's available in analytics:
1. Open the site and go to the
Admin tab.
2. In the
View column, select
View Settings.
3. Switch on
Site search Tracking.
4. Enter
Highlight as the
Query parameter, and select
Strip query parameters out of URL.
Obviously you need to first include the Google Analytics tracking code in your project.
This works for HTML5 Top Nav and Side Nav skins, but not Tripane.