Google Analytics: Tracking Sales When Multiple Sites Use a Single Checkout

Google Analytics: Tracking Sales When Multiple Sites Use a Single Checkout

March 11, 2019 4:03 pm

Bigger ecommerce corporations typically create a number of branded web sites that feed right into a single checkout. For these corporations, monitoring which website generated the enterprise — income — might be tough. On this submit, I'll present a way for reporting the “supply of enterprise” metrics in Google Analytics.

1-800-Flowers

1-800-Flowers.com deployed a number of web sites beneath one umbrella in 2009. The technique continues to be in place 10 years later. One can observe it when going to 1800Flowers.com and seeing the varied manufacturers on the prime of every web page.

1-800-Flowers.com was one of the original merchants to incorporate multiple websites under one umbrella website in 2009.

1-800-Flowers.com was one of many unique retailers to include a number of web sites underneath one umbrella website in 2009. Click on picture to enlarge.

Buyers stay within the area they first landed even when they click on to different manufacturers. This presumably supplies a unified buying expertise by way of checkout.

However it isn't typical. Most retailers with a number of domains use for a checkout both of their major branded domains or one other non-branded URL.

 

When merchant “X” has websites “a.com”, “b.com,” and “c.com,” they all funnel into checkout on “d.com.” <em>Click image to enlarge.</em>

A service provider with three web sites — “a.com,” “b.com,” “c.com” —can funnel all right into a single checkout on “d.com.”

Measuring

To report “supply of enterprise” in Google Analytics, create a customized dimension, then assign a worth to that variable. To start out, create the customized dimension at Admin > Properties > Customized Definitions > Customized Dimensions.

create the custom dimension at Admin > Properties > Custom Definitions > Custom Dimensions.

Create the customized dimension at Admin > Properties > Customized Definitions > Customized Dimensions. Click on picture to enlarge.

Then click on “New Customized Dimension.”

Click "New Custom Dimension."

Click on “New Customized Dimension.”

Give it a reputation, reminiscent of “Supply of Enterprise.” Set the scope to “Session” and click on “Create.”

Assign a name, such as “Source of Business.” Set the scope to “Session” and click “Create.”

Assign a reputation, similar to “Supply of Enterprise.” Set the scope to “Session” and click on “Create.”

The customized dimension is now created, prepared for info. Setting the scope to “Session” permits the reporting of the whole purchasing session with the “Supply of Enterprise” worth when somebody lands on the location. A “Hit” Scope shouldn't be advisable, as it might require the variable to be set with each interplay on the location, which is hard. A “Consumer” Scope would make sense if you wish to report the current session and all future periods with a single worth.

Including info to the “supply of enterprise” customized dimension requires a cookie, which is why I recommend utilizing Google Tag Supervisor. In any other case, skip to the “Shortcut” part, under, for a workaround.

Google Tag Supervisor

In Google Tag Supervisor, arrange the next variables.

Variable 1.

  • Identify: Touchdown Hostname
  • Variable Sort: URL
  • Element Sort: Host Identify

Variable 2.

  • Identify: LandingHostname
  • Variable Sort: Customized JavaScript [below]
perform() 
var landingHostname = Touchdown Hostname;
if(landingHostname) 
return landingHostname;
 else 
return "touchdown hostname unknown";


Additionally, arrange the next triggers in Google Tag Supervisor.

Set off 1.

  • Identify: doneWith_setLandingHostnameCookie
  • Set off Sort: Customized Occasion
  • Occasion Identify: doneWith_setLandingHostnameCookie
The setup for a Custom Events trigger.

The setup for a customized occasions set off.

Set off 2.

  • Web page View: DOM Prepared
  • Set off Sort: Web page View – DOM Prepared
Setup for Page View — DOM ready.

Setup for Web page View — DOM Prepared.

Arrange the next tags.

Tag 1.

  • Identify: landingHostname
  • Tag sort: Customized HTML
  • Tag contents: [The following tag, below, sets a cookie that lasts the duration of a session. It comes from my company’s collection of GTM tags and can be configured to last a certain amount of time. Disregard that code as needed.]
// CustomHTML - solely set off on "url question clickid" is just not null

      perform createCookie(identify,worth,days) 
        if (days)  // If not offered, it is going to be a session cookie.
          var date = new Date();
          date.setTime(date.getTime()+(days*30*60*one thousand)); // 30mins in milliseconds 
          var expires = "; expires="+date.toGMTString();
        
        else var expires = "";
        doc.cookie = identify+"="+worth+expires+"; path=/";
      

      perform readCookie(identify) 
        var nameEQ = identify + "=";
        var ca = doc.cookie.cut up(';');
        for(var i=zero;i < ca.size;i++) 
          var c = ca[i];
          whereas (c.charAt(zero)==' ') c = c.substring(1,c.size);
          if (c.indexOf(nameEQ) == zero) return c.substring(nameEQ.size,c.size);
        
        return null;
      

      if (!readCookie('landingHostname')) 
        createCookie('landingHostname', 'landingHostname', 1);
      

   window.dataLayer = window.dataLayer || [];
   dataLayer.push("occasion": "doneWith_setLandingHostnameCookie");

 

Word that the tag, above, wants to fireside earlier than your web page monitoring code. The next screenshot exhibits how I set this up in a GTM container.

Setup this tag before your page tracking code.

Arrange this cookie-setting tag earlier than the web page monitoring code.

Arrange a set off to fireside on each “Web page View – DOM Prepared.”

Set up a trigger to fire on every "Page View – DOM Ready."

Arrange a set off to fireside on each “Web page View – DOM Prepared.”

Tag 2.

  • Identify: GA Touchdown Hostname Occasion
  • Tag Sort: Google Analytics – Common Analytics
  • Monitor Sort: Occasion
  • Class: Touchdown Web page Hostname
  • Motion: Set
  • Label: landingHostname
Landing Page Hostname tag configuration.

Touchdown Web page Hostname tag configuration.

Then on this tag’s settings, or in your Google Analytics settings (in the event you arrange a variable for these), set the customized dimension’s index and worth. The index is predicated on the index you used to create the customized dimension. The worth can be landingHostname.

The triggering can be what you created at “doneWith_setLandingHostnameCookie.”

Publish your work in Google Tag Supervisor and you need to begin reporting knowledge.

Reporting

Reproduce the next customized report in Google Analytics to generate “periods,” “transactions,” and “ecommerce conversion fee by supply of enterprise.”

Dimensions

  • Supply Of Enterprise [or whatever name you gave for the custom dimension]

Metrics

  • Periods
  • Transactions
  • Ecommerce conversion price
  • Another metrics you select to incorporate
A Custom Report can be reproduced to generate Sessions, Transaction and Ecommerce Conversion Rate by Source of Business.

Generate a customized report for periods, transactions, and ecommerce conversion fee by supply of enterprise. Click on picture to enlarge.

The output will seem like the next. (I blocked out the precise supply of enterprise to guard the shopper’s id.)

Your output should include Sessions, Transactions and Ecommerce Conversion Rates

Your output ought to embrace Periods, Transactions and Ecommerce Conversion Charges. Click on picture to enlarge.

Shortcut

A shortcut which will work if you don't use GTM is to go to the Conduct > Website Content material > Touchdown Pages report. Then use “Hostname” as your main dimension and “Touchdown Web page” because the secondary.

A shortcut that may work as your primary and secondary dimension.

A shortcut which will work as your main and secondary dimension. Click on picture to enlarge.

Then, report by “Ecommerce,” which is close to the highest of the report. It will present a desk of knowledge, which might be exported to a CSV file or Google Sheets. Then create a pivot desk in Excel to report knowledge by Hostname.


You may also like...