contact us

Feel free to reach out to us using the form to the right, or contact us us directly.

 

info@ewbanaltyics.com | 5o8-650-0271

 

PO Box 433
Natick, MA 01760
USA

508.650.0271

EWB Analytics Blog

Filtering Ecommerce Transactions Across Multiple Subdomains in Google Analytics

Elizabeth Brady

There are two options for installing roll-up reporting for an e-ecommerce site that spans multiple subdomains with a requirement to report both at the subdomain as well aggregated level.  The first option involves setting up a distinct Google Analytics account (and tracking code) for each subdomain, and then installing a secondary tracking code (a rollup tracker) across all subdomains to capture the rollup data.  However, the complexities for this ‘non-standard’ implementation are well documented (see Brian Clifton, Justin Cutroni among others).  First, the installation requires extra tagging to pass ecommerce data to both accounts.  Additionally, the fact that the Google Analytics cookie is shared for any one page introduces many complexities for implementation and analysis.  

For a site with multiple subdomains, a single currency, and no plans for independent Adwords accounts, a single Google Analytics account with filtered profiles is a less complex option.  However, a basic ‘hostname’ filter that filters all page data by subdomain in the Google Analytics profile will not filter ecommerce transactions.  By default, all ecommerce transactions for the Google Analytics account will show up in every profile associated with the account.  In order to limit the ecommerce transactions to those that occurred on a specific subdomain, each profile requires its own filter for transactions as well as a filter for transaction items.  Before opting for this installation, be sure to understand the filters required, in order to design the site tags correctly.

The first filter field requires a custom filter on the field “E-commerce Store or Order Location”.

The data used for this filter is the “affiliation or store name” field in the addTrans data.  Google Analytics own sample code: 

_gaq.push(['_addTrans',
    '1234',           // order ID - required
    'Acme Clothing',  // affiliation or store name (use this to differentiate Partner sites or subdomains)
    '11.99',          // total - required
    '1.29',           // tax
    '5',              // shipping
    'San Jose',       // city
    'California',     // state or province
    'USA'             // country
  ]);

Interestingly, this filter alone will not thoroughly filter all ecommerce transaction from another site or subdomain.  Without an additional order item filter, product revenue and quantity data will still show up in all profiles associated with the account (even without associated transaction and order revenue data, which are filtered by the 'affiliation or store name' filter).

A second filter at the item level can be applied, but requires a site/subdomain identifier in the data collected. 

By appending the subdomain/site/store name to the item variation during the tagging and data collection process, this can be used to filter order items by subdomain:

 _gaq.push(['_addItem',
    '1234',           // order ID
    'DD44',           // SKU code
    'T-Shirt',        // product name
    'Green Medium',   // category or variation, append the subdomain here ‘Subdomain_category’
    '11.99',          // unit price - required
    '1'               // quantity - required
  ]);