Google eCommerce Tracking (not tracking) in AspDotNetStorefront

Last week an industry partner that specializes in PPC management with AspDotNetStorefront was having an issue with one of their new client’s websites. They brought us into the mix to review and diagnose the client’s site to resolve why Google’s ecommerce tracking code wasn’t registering all customer orders, rather just some orders intermittently.

After speaking with the storeowner, it was apparent he was equally as frustrated by the tracking code not working. After all they are trying to measure the success of a PPC campaign and not getting the right data. That’s frustrating for everyone.

The client has been using another developer that built the store and was certainly concerned about letting another company into the server to check things out. His loyalty to that party was appreciated, and that’s the kind of client we enjoy working with. In the end, he agreed that another set of qualified eyes wouldn’t hurt anything.

The store is built on AspDotNetStorefront version 8.0.1.2. That’s an older version of the Vortx AspDotNetStorefront software but still a very viable platform. The client is interested in upgrading the software version as well as the design, but wasn’t sure if this issue was associated with AspDotNetStorefront or if it was a more programmatic error.

If it was inherent in the software, then he wanted to evaluate other platforms like Magento or Shopify. We have many different stores that we manage on AspDotNetStorefront and knew it couldn’t be the software. These are all good platforms and yet converting a store with hundreds, maybe thousands of products is a nightmare.

After conducting a thorough audit of the site code, the appconfig settings and overall order flow, we determined a few elements were causing this issue.

Here is what we found:

  1. The code was missing a couple of /div tags to close things out so the java script wasn’t firing correctly in all browsers.

  2. The IncludeGoogleTrackingCode appconfig was set to false. This setting should be set to true as per the software manual and our prior findings.

  3. Some product names had the quote symbol (“) for inches. This proved to be the biggest hindrance to data tracking.

These issues, although seemingly simple, were prohibiting the data transfer to Google Analytics and the eCommerce tracking.

Here’s why.

  1. The missing /div tags were breaking the code in some browsers. Other browsers like Firefox would repair the broken code to still run the script, most would not. That was fix #1, to ensure that we have compliance with browsers and they are all properly executing the ga.js script.

  2. We confirmed that the Google.EcomOrderTrackingEnabled was set to “true” in the appconfig and that the GOOGLE_ECOM_TRACKING_V2 token was properly inserted into the page skin. This appconfig determines whether the Google ecommerce tracking code is fired on the order confirmation.

  3. The Google tracking code sends data back to Google Analytics and requires it to be compiled correctly in a particular format. In this case, some of the product names included the “ character for inches. We found that this duplicated “ characters within the data string and that caused them to fail. You have two options, remove the “ and add inches (or similar) or use " in the product name. The browser renders it as “ on screen, but it passes to Google with the " in the name and registers fine. Here’s a sample.

    var pageTracker = _gat._getTracker(“UA-1234567-1”);
    pageTracker._initData();
    pageTracker._trackPageview();
    pageTracker._addTrans(“ORDER#”,””,”0.00″,”0.00″,”0.00″,”Orlando”,”FL”,”United States”);
    pageTracker._addItem(“ORDER#”,”SKU#”,”PRODUCT NAME #1: 10″ x 1.75″”,”CATEGORY”,”PRICE”,”QTY”);
    pageTracker._addItem(“ORDER#”,”SKU#”,” PRODUCT NAME #2″,”CATEGORY”,”PRICE”,”QTY”);
    pageTracker._trackTrans();

    var pageTracker = _gat._getTracker(“UA-1234567-1”);
    pageTracker._initData();
    pageTracker._trackPageview();
    pageTracker._addTrans(“ORDER#”,””,”0.00″,”0.00″,”0.00″,”Orlando”,”FL”,”United States”);
    pageTracker._addItem(“ORDER#”,”SKU#”,” PRODUCT NAME #1: 10" x 1.75"”,”CATEGORY”,”PRICE”,”QTY”);
    pageTracker._addItem(“ORDER#”,”SKU#”,” PRODUCT NAME #2″,”CATEGORY”,”PRICE”,”QTY”);
    pageTracker._trackTrans();

Our team focused a few hours on this client’s site to determine why the Google eCommerce tracking code wasn’t working correctly. Now that we’ve fixed the code and the client’s product names (simple SQL script to replace “ with "), our client’s Google Analytics account is recording orders correctly, and now we can provide accurate conversion metrics. In the world of digital marketing, no tracking means no visibility. If you can’t measure what’s working, well, that’s never good.

Hopefully this article helps you solve a simple, yet frustrating problem.

Tags: , , , , ,

X CLOSE