Posts Tagged ‘Google Analytics Site Search’
Google Analytics Site Search Setup Guide
Brad Henry | September 16th, 2008in Google Web Optimizer
1. Starting from the “Analytics Settings” page, click “Edit” under settings, then click “Edit” again under the main Website Profile Information section. This will present the following options.
2. Select “Do Track Site Search”
3. Complete a Site Search on your website and view the resulting URL and find the keyword phrase you used as a test. Identify the query parameter that immediately precedes your test query and insert it into the Query Parameter box as seen in the setup below. Be sure to replace with your parameters versus what is in the example below.
4. If you have categories, follow the same test and place your Category Parameter in the box below as well.
![]()
Google Analytics Tracking Code for Results Hosted on SubDomain:
** Must be placed on every page on both the main domain and the search results sets.
<script type=”text/JavaScript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-789266-1″);
pageTracker._setDomainName(“replacewithyourdomain.com”);
pageTracker._initData();
pageTracker._trackPageview();
</script>
Google Analtyics Tracking Code for Third Party Tracking:
Complete the steps listed above and follow the instructions listed below.
The following code must be placed on all pages on both websites.
<script type=”text/JavaScript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-642481-1″);
pageTracker._setDomainName(“replacewithyourdomain.com”)
pageTracker._setAllowLinker(true);
pageTracker._setAllowHash(false);
pageTracker._initData();
pageTracker._trackPageview();
</script>
The action in the form must also contain an onsubmit event using the following code:
“pageTracker._linkByPost(this)”
** Every link on either site that allows visitors to cross each domain including all search results must also contain the following code in the onclick event:
pageTracker._link(‘http://www.websiteaddress.com’); return false;
Ecommerce Setup and Tracking:
Access the “Edit Profile Information” configuration through the same steps as setting the Site Search.
Select “Yes, an E-commerce Site”
Select your currency and related settings.
You will need to embed the following GA Ecommerce Tracking code into your website’s ecommerce Confirmation Page. This code will need to be integrated with your existing ecommerce platform and will have to dynamically extract the information either from the database or from variables that can be carried over from the shopping cart.
** This step will require programming knowledge and custom programming in order to extract the correct variables and build an array for instances where there may be multiple products. The array will then dynamically add all the products and build the correct coding to deliver the information to Google Analtyics. If this step is not completed correctly, your ecommerce will not function. You can not copy and paste the code below and have it function for your system.
<script type=”text/javascript”>
pageTracker._addTrans(
“order-id”, // required
“affiliate or store name”,
“total”,
“tax”,
“shipping”,
“city”,
“state”,
“country”
);pageTracker._addItem(
“order-id”, // required
“SKU”,
“product name”,
“product category”,
“unit price”, // required
“quantity” //required
);pageTracker._trackTrans();
</script>
Example of Reports Available Once Setup is completed:
The reports above are only a few examples of the available reports. You have the option to dig down on any of these and investigate peculiar or interesting information in much further detail. I hope this has been helpful and if you have any questions, please let me know.
Thanks,
Brad
Tags: Ecommerce and Site Search, GA Site Search, Google Analytics Site Search
Posted in Google Web Optimizer | 3 Comments »