This article explains how you can track greenback user behaviour within your own Google Analytics (GA) reports.

(blue star) 4 easy steps

  1. Contact your Custogmer Success representative to turn on your ‘data layer’ greenback events

  2. Create custom variables to pass data layer values into your Google Tag Manager (GTM)

  3. Create custom tags in your GTM to pass the data to your GA

  4. Create the custom variables in your GA4 to use them in your reports

This guide covers passing all of the available greenback events into your GA, however you can choose to pass only the ones you need

(tick) Step 1: Check the data layer is turned on

After your CS rep has confirmed this is now activated, open up Google Chrome browser:

You’re now ready to join this custom data to your GA using GTM.


(blue star) Step 2: Pass greenback data into Google Tag Manager (GTM)

2a. Create the GTM Data Layer Variables

This will allow any GTM tags to use the preezie data variables (as GA4 parameters) in various ways.

First go to your GTM account:

  1. Variables > User-Defined Variables > New

  2. Give it a name of greenback.products

  3. Click Variable Configuration > Data Layer Variable

  1. In Data Layer Variable Name enter greenback.products hit Save

Variable name (8 Data Layer Variables)

Data Layer Variable Name

What it captures

greenback.visitorid

greenback.visitor.id

The user using the greenback widget

greenback.sessionid

greenback.session.id

The user using the greenback widget

greenback.page

greenback.page

The page that user is on

greenback.message

greenback.message

The message user sent in greenback

greenback.isSuggestedText

greenback.is.suggested.text

The message is coming from suggested text

greenback.products(array)

greenback.products

The products recommended

greenback.productid

greenback.product.id

The unique id of the clicked product in the recommended products (as defined by your product feed)

greenback.position

greenback.product.position

The position the clicked product was ranked in the recommendation products

greenback.productname

greenback.product.name

The name of the product that was clicked on.

greenback.productPrice

greenback.product.price

The price of the product that was clicked on

greenback.triggerType

greenback.trigger.type

The trigger type of the external trigger

Variable name (Custom Event)

What it captures

greenback.view

When the greenback loads

greenback.externalTrigger

When the external trigger fires

greenback.opened

When the chat model opened

greenback.1stMessageSent

When the 1st message sent

greenback.messageSent

When the message sent

greenback.productRecommended

Products recommended

greenback.productClick

A click on a product recommendation

greenback.addToCart

When add-to-cart is performed

greenback.restart

When chat is restarted

greenback.closed

When widget is closed

You now have your new variables, they should look like this:

Variable name (Custom Event)

What it captures

greenback.pdp.view

When the greenback loads

greenback.pdp.externalTrigger

When the external trigger fires

greenback.pdp.1stMessageSent

When the 1st message sent

greenback.pdp.messageSent

When the message sent

greenback.pdp.productRecommended

Products recommended

greenback.pdp.productClick

A click on a product recommendation

greenback.pdp.addToCart

When add-to-cart is performed

greenback.pdp.restart

When chat is restarted

2b. Create the GTM triggers for your tags

In your GTM account, create these triggers before you create your tags:

greenback ‘view’ event

Now repeat these steps for the other 8 triggers:

Name (9 triggers)

Trigger Type

Event name

What it captures

greenback.view

Custom Event

greenback.view

Each time a greenback widget loads on the page

greenback.externalTrigger

Custom Event

greenback.externalTrigger

Each time the external trigger fires

greenback.opened

Custom Event

greenback.opened

Each time the user opens greenback widget

greenback.1stMessageSent

Custom Event

greenback.1stMessageSent

When the user sent the first message

greenback.messageSent

Custom Event

greenback.messageSent

When a message is sent from user

greenback.productRecommended

Custom Event

greenback.productRecommended

When products are recommended

greenback.productClick

Custom Event

greenback.productClick

Each click to product in the recommended products

greenback.addToCart

Custom Event

greenback.addToCart

When product is add to the cart

greenback.restart

Custom Event

greenback.restart

When user restart the chat

greenback.closed

Custom Event

greenback.closed

When greenback widget is closed

PDP Tags

Name (9 triggers)

Trigger Type

Event name

What it captures

greenback.pdp.view

Custom Event

greenback.pdp.view

Each time a greenback widget loads on the page

greenback.pdp.externalTrigger

Custom Event

greenback.pdp.externalTrigger

Each time the external trigger fires

greenback.pdp.1stMessageSent

Custom Event

greenback.pdp.1stMessageSent

When the user sent the first message

greenback.pdp.messageSent

Custom Event

greenback.pdp.messageSent

When a message is sent from user

greenback.pdp.productRecommended

Custom Event

greenback.pdp.productRecommended

When products are recommended

greenback.pdp.productClick

Custom Event

greenback.pdp.productClick

Each click to product in the recommended products

greenback.pdp.addToCart

Custom Event

greenback.pdp.addToCart

When product is add to the cart

greenback.pdp.restart

Custom Event

greenback.pdp.restart

When user restart the chat

(blue star) Step 3: Create GA4 tags

Now you need to create tags to tell GA what event data is available. Each event fired contains parameters, you can choose which parameters you’d like to send to GA4 (full details).

3a. Tag set up

If you want to include other parameters just use the same format with the variables from Step 2a.

Tag name

Taq type

Configuration Tag

Event Name

Event Parameter Name

Value

Trigger (as per Step 2b)

GA4 greenback_view

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_view

greenback_page

{{greenback.page}}

greenback.view
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_externalTrigger

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_externalTrigger

greenback_page

{{greenback.page}}

greenback.externalTrigger
Custom Event

greenback_message

{{greenback.message}}

greenback_trigger_type

{{greenback.triggerType}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_opened

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_opened

greenback_page

{{greenback.page}}

greenback.opened
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_1stMessageSent

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_1stMessageSent

greenback_page

{{greenback.page}}

greenback.1stMessageSent
Custom Event

greenback_message

{{greenback.message}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_messageSent

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_messageSent

greenback_page

{{greenback.page}}

greenback.messageSent
Custom Event

greenback_message

{{greenback.message}}

greenback_is_suggested_text

{{greenback.isSuggestedText}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_productRecommended

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_productRecommended

greenback_page

{{greenback.page}}

greenback.productRecommended
Custom Event

greenback_message

{{greenback.message}}

greenback_products

{{greenback.productRecommended}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_productClick

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_productClick

greenback_page

{{greenback.page}}

greenback.productClick
Custom Event

greenback_product_id

{{greenback.productid}}

greenback_product_name

{{greenback.productname}}

greenback_product_position

{{greenback.position}}

greenback_product_price

{{greenback.productPrice}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_addToCart

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_addToCart

greenback_page

{{greenback.page}}

greenback.addToCart
Custom Event

greenback_product_id

{{greenback.productid}}

greenback_product_name

{{greenback.productname}}

greenback_product_price

{{greenback.productPrice}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_restart

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_restart

greenback_page

{{greenback.page}}

greenback.restart
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_closed

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_closed

greenback_page

{{greenback.page}}

greenback.closed
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

Tag name

Taq type

Configuration Tag

Event Name

Event Parameter Name

Value

Trigger (as per Step 2b)

GA4 greenback_pdp_view

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_view

greenback_page

{{greenback.page}}

greenback.pdp.view
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_externalTrigger

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_externalTrigger

greenback_page

{{greenback.page}}

greenback.pdp.externalTrigger
Custom Event

greenback_message

{{greenback.message}}

greenback_trigger_type

{{greenback.triggerType}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_1stMessageSent

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_1stMessageSent

greenback_page

{{greenback.page}}

greenback.pdp.1stMessageSent
Custom Event

greenback_message

{{greenback.message}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_messageSent

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_messageSent

greenback_page

{{greenback.page}}

greenback.pdp.messageSent
Custom Event

greenback_message

{{greenback.message}}

greenback_is_suggested_text

{{greenback.isSuggestedText}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_productRecommended

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_productRecommended

greenback_page

{{greenback.page}}

greenback.pdp.productRecommended
Custom Event

greenback_message

{{greenback.message}}

greenback_products

{{greenback.productRecommended}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_productClick

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_productClick

greenback_page

{{greenback.page}}

greenback.pdp.productClick
Custom Event

greenback_product_id

{{greenback.productid}}

greenback_product_name

{{greenback.productname}}

greenback_product_position

{{greenback.position}}

greenback_product_price

{{greenback.productPrice}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_addToCart

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_addToCart

greenback_page

{{greenback.page}}

greenback.pdp.addToCart
Custom Event

greenback_product_id

{{greenback.productid}}

greenback_product_name

{{greenback.productname}}

greenback_product_price

{{greenback.productPrice}}

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

GA4 greenback_pdp_restart

Google Analytics: GA4 Event

(Select your GA4 variable within GTM)

greenback_pdp_restart

greenback_page

{{greenback.page}}

greenback.pdp.restart
Custom Event

User Properties

greenback_user

{{greenback.visitorid}}{{greenback.sessionid}}

These events now need to be configured in GA4.

3b. Mapping your Custom events into GA4

Each GTM event will automatically fire into GA4 however you now need to set up the additional ‘values’ sent with each event.

Dimension name

Scope

Description

Event parameter
*note, must match your GTM parameter names!

greenback_page

Event

Which page the greenback was on

greenback_page

greenback_message

Event

What message was sent to greenback

greenback_message

greenback_trigger_type

Event

What trigger type triggered in external trigger

greenback_trigger_type

greenback_is_suggested_text

Event

When a message is from suggested text

greenback_is_suggested_text

greenback_products

Event

What products are recommended to user

greenback_products

greenback_product_id

Event

The unique ID of the clicked product

greenback_product_id

greenback_product_name

Event

The name of the clicked product

greenback_product_name

greenback_product_position

Event

The rank position of the clicked product in the product recommendation

greenback_product_position

greenback_product_price

Event

The price of the clicked product

greenback_product_price

preezie_user

User

The user who interacted with greenback

greenback_user

Make sure the event parameter names are identical to your GTM parameter Names.
Note, all are Event scoped except for preezie_user.

That’s it!

Note: It can take up to 24 hours for these events to show within your GA4.

Remember to submit/publish your tag manager changes so it can become active.

(blue star) Step 4: How to use the data in GA

These events will give you the ability to segment/group behaviour.

But you can also breakdown by matching exactly/partially on the text of the values, e.g.

A full event definition guide can be found here: Using Data Layer with Greenback

(blue star) Related articles

Some additional reading:

https://support.google.com/tagmanager/answer/6164391?hl=en

https://support.google.com/analytics/answer/10085872?hl=en