How can I set up Ecommerce Tracking in Google Analytics and see the revenue of my Shore bookings?

Prerequisites

In order to set up Google Analytics tracking, you need:

Important: You need to have the same Google Tag Manager container on your website and inside your booking widget. Please get in touch with our customer support so we can install it for you. You have to request the installation of Google Tag Manager.

 

Steps in Google Tag Manager

Before you get started, you have to follow the tutorial How can I view my bookings in Google Analytics and see which campaign performs best? and create your first Goal to capture a successful booking.

1. Create a Custom Variable for the Transaction ID

Google Analytics Ecommerce Tracking requires you to have a transaction ID. Since Shore's Data Layer does not provide any ID for a successful booking, we are going to add a Random Number. Please note that this ID is not saved in your Shore backoffice. It is only visible in Google Analytics.

Ecommerce-variable-id.png

2. Create a Custom Event trigger for the Data Layer push

We have to create a trigger to push the revenue data into the Data Layer. The push will happen after the total amount of all booked services has been calculated (enter-details and success-booking steps)

 

Trigger type: Custom Event
Event name: event-to-ga
Some Custom Events:
{{eventLabel}} matches RegEx: (enter-details)|(booking-success)

Ecommerce-trigger-datalayerpush.png

3. Create a Custom Event trigger for the Google Analytics Transaction tag

The Google Analytics Transaction tag needs to fire on a successful booking.

Ecommerce-trigger-transaction.png

4. Create a Custom HTML tag for the Data Layer push

Now we have to create a new Custom HTML tag that will update the {{transactionTotal}} variable with the correct amount. Since the {{eventValue}} variable is in cents, it has to be divided by 100 before it is sent to Google Analytics.

 

<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'transactionId': {{randomNumber}},
'transactionTotal': {{eventValue}}*0.01,
});
</script>

Don’t forget to add the Custom Event trigger you created for the Data Layer push!

Ecommerce-tag-datalayerpush.png

5. Create a Google Analytics Transaction tag

In the Tag Configuration, enter Universal Analytics as tag type and apply the following settings:

 

Track type: Transaction
Event name: event-to-ga
Google Analytics settings: {{Google Analytics Variable}}

Don’t forget to add the Custom Event trigger you created for the transaction tag!

Ecommerce-tag-transaction.png

 

Steps in Google Analytics

1. Activate Ecommerce Tracking on the Admin page of your Google Analytics account

Ecommerce-GA-activate.png

 

2. Check your Transactions and Revenue in the Ecommerce section

Ecommerce-GA-view.png 

 

Was this article helpful? 0 out of 1 found this helpful

Comments