Google Trusted Stores & ShopSite – A Winning Combination
With the release of Google Trusted Stores, merchants have been signing up and implementing the tracking code on their stores. While the seal code is simple to implement, the code needed on a store’s Thank You page is quite complex. Google needs to receive a lot of details to properly track the order in their system. In this post we’ll cover what to look out for when implementing the order confirmation code in a ShopSite store.
Get Google’s Code
Here is Google’s documentation about the code which needs to be added to a store, and it also include a copy of sample tracking code:
https://support.google.com/trustedstoresmerchant/bin/answer.py?hl=en&answer=2609894&ctx=go
The “Google Trusted Store badge” section at the top is the basic code which displays the seal on a page, and the “Order Confirmation Module” farther down goes on a store’s Thank You page. The Order Confirmation code is what we’ll focus on here.
Store & Order Details
As you will see in the “” section of the code, it covers store specific details such as your domain name as well as order details such as the Order ID and some pricing.
With ShopSite you can obtain most of the order values with their javascript variables:
http://www.shopsite.com/help/11.2/en-US/sc/pro/cart.variables.html
For example, where Google shows this in their code:
<span id=”gts-o-id”>MERCHANT_ORDER_ID</span>
..you can replace that with:
<script language=”javascript” type=”text/javascript”>document.write(‘<span id=”gts-o-id”>’ + ss_ordernum + ‘</span>’);</script>
That uses javascript to include the ShopSite order number in the code.
- TIP: For the ORDER_EST_SHIP_DATE value, you can use javascript to add a set number of days (ex: 7) to the current date and pass that value as the ORDER_EST_SHIP_DATE. That will submit an ORDER_EST_SHIP_DATE of 7 days from the order date.
Product Details
The “<!– start repeated item specific information –>” section of code is where things get tricky. As you will see in the code, Google wants to know the name, price, quantity, and product search ID for all the products on the order.
Everything but the product search ID is available in the javascript variables, and ShopSite stores them all in an array. To provide the values to Google your code will need to loop through the arrays for each value. The javascript variable “number_products” will help as that is the total number of line items on the order, so you can loop through the array that many times in order to send all the details.
As we mentioned above, the Product Search ID value is not one of the variables. This ID is the product record number in ShopSite’s database and is not something seen on a regular basis. But that doesn’t mean you can’t get to it.
On ShopSite’s Utilities > Database > Download screen, you can download your product database to obtain the ID. The trick here is you must select “version 10.1″ or earlier for the version as the Product ID was removed from the newer download formats. Download the Product ID, and either the Product Name or SKU (whichever is unique for your store).
Next, upload that same file back to ShopSite but on the upload match the Product ID column to an unused Extra Product Field. Extra product fields are available as javascript variables so you can store the Product ID as an extra field and loop through the array just like the other product fields.
- Note: Before any database upload always use the “Backup” button on the Utilities > Database screen to save a copy of the current data.
The Simple Way To Integrate
Are you hosting your store here at LexiConn? If so we have a script we can provide for your Thank You screen which will submit all of the tracking details, including the storage of the Product ID into an extra field.
We’re also working on a plugin for our Order Status Module, which will submit the Shipment Feed which Google also wants to see. We should have that available in the next few weeks.
If you are not hosted with us, you may be interested in reading about our seamless transfer process. For more details about signing up with LexiConn or if you are a client and would like the tracking script for your store, please contact us.
Looking for a web host that understands ecommerce and business hosting?
Check us out today!