Enhanced Ecommerce for Google Analytics

Enable Setting

images/gtag-ee.jpg

Go to the 'Apps' page on your Kiva Logic admin, navigate to the Google Tag Manager Section, and enable the Enhanced Ecommerce setting.

Events

Checkout Step 1

When the customer has selected a box and entered the checkout process, they are on step 1. At this step, they enter in their name, email, address.

This is what the dataLayer.push() for the first checkout step would look like:


    window.dataLayer = window.dataLayer || [];

    window.dataLayer.push({

      event: 'eec.checkout',

      ecommerce: {

        checkout: {

          actionField: {

            step: 1                   

          },

          products: [{

            id: '2',

            name: 'BEEF, PORK & CHICKEN',

            category: 'Boxes',                                      

            quantity: 1                            

          }]

        }

      }

    });

Checkout Step 2

Afer entering in their name/address, they are on step 2. This is the step where they are prompted for their schedule selection and they must enter in their payment info.

This is what the dataLayer.push() for the second checkout step would look like:


    window.dataLayer = window.dataLayer || [];

    window.dataLayer.push({

      event: 'eec.checkout',

      ecommerce: {

        checkout: {

          actionField: {

            step: 2                     

          }

        }

      }

    });

Checkout Completed

Upon entering payment information and completing the checkout process, we send a 'purchase' event on the "Thank You" page (we also call this page the "first time" page fyi).

  • variant is the schedule the customer selects

  • the 'eec.purchase' event will only be fired once, so if the customer reloads the page, it will not be re-fired.

This is what the dataLayer.push() for the checkout complete would look like:


    window.dataLayer = window.dataLayer || [];

    window.dataLayer.push({

      event: 'eec.purchase',

      ecommerce: {

        currencyCode: 'USD',

        purchase: {

          actionField: {

            id: '28518',        

            revenue: '159',

            tax: '0',

            shipping: '0',

            coupon: 'BBQBUNDLE'

          },

          products: [{

            id: '2',

            name: 'BEEF, PORK & CHICKEN',

            category: 'Boxes',

            variant: 'EVERY 4 WEEKS',        

            quantity: 1,

            price: '159'               

          }]

        }

      }

    }); 

Reference Links

https://www.simoahava.com/analytics/enhanced-ecommerce-guide-for-google-tag-manager/

https://www.analyticsmania.com/post/ecommerce-tracking-with-google-tag-manager/

https://developers.google.com/tag-manager/enhanced-ecommerce

https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.