Gathering information about the usage of a retail site through reporting is critical to its success. To help you acquire and track usage data, Google provides the following options:
- Google Analytics
- GCS Statistics
- Google APIs Console
This section describes each of these options. By using all these options together, you can get a consolidated view of your users, product, and site efficiency.
Google Analytics Integration
Google Analytics (GA) is a separate product from GCS, and basic integration of GA with GCS is exactly the same as any customer integration of GA with a web site. However, there are some GCS-specific tracking codes that should be implemented which will help GCS learn about visitor behavior.
It is up to site administrators to register for Google Analytics and to configure it on their web pages. GCS customers are also free to implement any third-party web analytics software.
As stated, GA nor GCS has any native integration with each other and it is upto a site administrator to register for setup/configure Analytics. The steps to setup basic Analytics with GCS is pretty much the same as it is with most search/commerce sites:
- Add additional GCS-specific tracking code to product pages and GCS search results pages.
- Verify that Google Analytics is receiving tracking data.
- Enable Site Search Tracking in Analytics (shown on Figure 2 below).
- Specify the GET query parameter and category name sent to your site for each search.
Administrators may also want to track user transaction and site navigation behavior to get a full view effectiveness of GCS and how your customers end up using the site.
Detailed tracking of transactions and navigation for purchases is very useful in determining the best placement and effectiveness of product categories. This data could also be used to provide search Autocompletions and Recommendation. GCS customers must enable Google Analytics transaction tracking to use Recommendations.
Note: The examples and screenshots on this document assumes the query parameter sent from the browser to your webserver is
q. It also assumes the faceted navigation parameter sent to your webserver is called
&restrictBy=. Of course the actual GCS Search API calls must use
restrictBy but you are free to define the query and restriction parameters sent to your site.
The following code shows a sample Google Analytics Async tracking code. You could insert this into your search and results page if your webserver issues the GCS query (i.e. server-side rendering).
Note: Google Analytics is a separate product and is not supported through Google Commerce Search Enterprise Support.
Site Search contains reports about the visitors using the 'search' functionality on your website. Google Analytics Site Search reports deliver many useful pieces of information - for example, they can help you analyze how people use the search functionality on your site, and report its conversion metrics.
In the example, Figure 3 below shows the keyword queries users typed into this sample site. Analytics only counts unique queries, so if the same user typed in
q=shirt twice, Site Search would only show that once. For additional information about Site Search data, see "How We Calculate Site Search Metrics".
If you've defined Category filtering (in this example, the
&restrictBy= parameter from the browser to the webserver), you can drill down on a query term and see which facet filters your users selected. The count for each filter is zero since GA counts the query and its subsequent category refinements as one unique query. In the example below, users searched for
q=shirt 11 times and within those searches refined on the various Site Search categories listed.
Event tracking is used to augment the category reporting to log detailed events. The default category reports shows navigation drill down but not the counts of individual facet selection. Tracking custom events will show the category breakdown and selections made within that category. For example, if a visitor to your site
color(text)=Black the following code snippet will transmit event tracking data to GA once the result page for the restricts is shown:
Facet selection tracking should trigger on each successive restrict and could be cumulative. That is, if the user goes on to further restrict by price, the result page could transmit both selections:
_gaq.push(['_trackEvent', 'restrictBy', 'color(text)', 'Black']); _gaq.push(['_trackEvent', 'restrictBy', 'price', '[5.01,9.99)']);
Note: You can also use the
onClick= event when users select a refinement to trigger the tracking event.
Event details for the
color(text) action shows each value selected. In the screenshot below, four events were tracked where users refined on
For more information on Event Tracking, see:
Product Performance Tracking
GCS can further improve search relevancy on your site by constantly learning which products are clicked on and purchased for given user queries. Suppose for general queries like
q=shirt users clicked on certain
shirts and then went on to purchase some of them. Over time, GCS can use this behavior as a signal to promote those purchased/viewed shirts over others in subsequent results for the same query.
Configure Analytics and GCS
The first step is to enable data sharing with your Analytics account:
Under "All Accounts" > "Account List" > "Admin" (on the right) > Select your account > "Account Settings" click the "Share my Google Analytics data..." radio button and be sure the "With other Google products only" checkbox is checked. You must also set your Google Analytics ID on the GCS Control Panel. Configure Analytics to track every page on your site (see "How to set up the web tracking code").
Product page tracking
The first step of performance tracking is to install page view tracking on your page using custom variables.
For each product detail page, you should identify your unique productID string and transmit it to Analytics as the GCS_ProductID. You need to send over information about which item was just viewed as the unique ID field for that item.
So, if a customer on your site saw item "Organic Basic T-Shirt" that has the unique ID field of id=1013001, then the analytics call on that page would look like:
_gaq.push(['_setCustomVar', INDEX, 'GCS_ProductID', '1013001', 3]); _gaq.push(['_trackPageview']);where INDEX is a unique number from 1 - 5, SCOPE should be set to 3, custom variable name is 'GCS_ProductID' and your ID for that item is set as the custom variable. The ID should match the ID field submitted for the product in the Merchant Center product feed exactly.
See the Custom Variables docs for more information on how Custom Variables are used.
Click through tracking
The next step of performance tracking is to install click through tracking. There are two ways to enable click-through tracking:
- Enable the
&clickTracking=trueparameter for each GCS Query and use the modified
<s:link/>attribute as the link when customers click on a item.
- Manually setup Analytics to send search requestID using just Google Analytics custom variables.
Note: In both cases, you must setup Google Analytics for Transaction Tracking and data sharing as described below. You must also always send the
GCS_ProductIDindicating product page views.
The easiest way to implement performance tracking is to enable the
&clickTracking=trueparameter for each search query. GCS will rewrite each
s:linkattribute in the response and append a unique per-request tracking code to the URL for each item. The search result page should render the
s:linkparameter such that when your users click on an item, your users are taken to the modified product URL directly. For more information, see Click-Through Tracking. If you are using Google Analytics, you may want to exclude the GCS click-tracking query parameter
&gcsct=from your reports. See "Match Types: Head Match, Exact Match & Regular Expression Match".
Manually sending click data
GCS customers who do not want to rewrite the product detail URL will need to manually transmit the a per-request ID field on the item detail page. The first step to manually integrate Analytics & GCS is to add an additional Analytics tracking code to your search results pages (or category pages, if powered by GCS). All GCS queries return a unique requestID token that identifies this query. Whenever your users search or browse, the search result page should parse out the requestID and set it as an analytics custom variable on the result page.
_gaq.push(['_setCustomVar', 3, 'GCS_RequestID', 'YOUR UNIQUE REQUEST ID', 3]); _gaq.push(['_trackPageview']);The request id is the unique per-search GCS response token. Atom XML:
Note: Use different variable INDEX numbers for
- Enable the
- The final step is to enable Transaction Tracking as described in the following section.
Suppose a visitor to your site added two items to the shopping cart, proceeded to checkout and completed the transaction. The 'purchase complete' page would track the total transaction order as well as list out both items in the shopping cart:
Detailed tracking of transactions and navigation for purchases is very useful in determining the best placement and effectiveness of product categories.
For more information on Transaction Tracking, see:
Zero Results Tracking
The standard reports in Google Analytics provide lots of great information, but the basic tracking code can only do so much -- it is only able to log information that is in the page URL, and actual content from the page doesn’t normally get saved to GA. One situation where you might want to feed GA a little extra information is when GCS doesn’t find any matching items (zero results returned).
One way to log “extra” info to GA is by using Custom Variables. For logging Zero results, you would just add this line to the tracking code when GCS returns totalResults = 0:
_gaq.push(['_setCustomVar', 1, 'ZeroResults', '*query term here*', 3]); _gaq.push(['_trackPageview']);
This creates a custom variable named “ZeroResults”, and you’ll get a report of all the query terms under Visitors -> Custom Variables.
The GCS Statistics panel displays the number of unique keyword queries GCS received and does not include successive query facet refinements or
page navigation. For example, if a user searches for
q=shirt then another later restricts on
&restrictBy=color=black, these two GCS API calls
shows as one unique query but counts as two calls for licensing purposes. The terms and query-term counts listed is an estimate and may differ from exact numbers and is
provided as guidance to general site usage.
Google APIs Console
Every Search API for Shopping query must include an API key (
&key= parameter) that the customer can use to track inbound calls. The usage of the API key is tracked and controled through the API Console. Administrators can see the the Total Requests and Requests/day as well as the usage distribution over time. The API usage shows the total number of inbound queries using this key which may include searches on your site, search-as-you-type requests, custom monitoring scripts and sample searches on the GCS Admin Preview panel.
Customers may want to use separate keys for different sites to better track API usage per site (for example, one key for us.yoursite.com and another for uk.yoursite.com). Search-as-you-type users should also use separate keys to monitor and control usage.