Data Layer
Zephr has the ability to integrate with your analytics platform and third party systems by writing user information to a data layer.
A data layer is a JSON data object found within a user’s browser for integration with third-party systems such as Google Analytics and Adobe Analytics. By writing to a user’s data layer, Zephr is able to share vital behavioural, journey and usage information. The data layer is user and browser-specific and is written to with each page view. This is known as a data layer push.
A data layer is made up of a list of key/value pairs. A key is a category of things – for example, the user attribute ‘City’. Each key can have different values – so a user may have a key/value pair of City: London, or of City: New York, depending on the details they have provided. Likewise, when using a Zephr meter count as a key, you will see varying values for each user.
Why use Zephr Data Layer?
The Zephr Data Layer is incredibly helpful for recording and analysing core user behaviour and consumption patterns. Some examples of how our clients are using our Data Layer feature include:
- Monitoring remaining trial values to examine how free trials are being consumed
- Using Test Group analytics to monitor results of bucket testing within Zephr Rules
- Monitoring the number of active sessions to track fair use of subscriptions
Configuring your Data Layer with Zephr
- Navigate to Settings > Data Layer.
- In the Configuration section:
- In the Data Layer Name field, enter a name for your data layer. By default, this is set to dataLayer, commonly used with Google Analytics.
- Choose the Enabled setting to enable your data layer configuration. This calls the Zephr data layer endpoint and pushes the information to window.dataLayer for a tag manager to pick up.
- In the Feature Outcomes section (Fields section):
- Configure the information you want Zephr to write to the data layer for ingestion by your analytics platform.
- To add a variable, click Add Field, then choose the variable you would like written from the Selector Type field. Selector Types include:
- User Schema - Select specific attributes from the Zephr User Schema. For example, choosing "First Name" will write data to the layer as first-name: Gwen.
- Activity - Choose to write data on the following activities:
- loggedIn: Indicates whether the user is logged in (true/false).
- activeSessions: Displays the number of active sessions for the user.
- trackingId: Writes the user’s Zephr Tracking ID to the data layer.
- Active Products - Writes data about a user’s active product grants.
- Test Group - Specify a Test Group per field, indicating whether the user belongs to Group A or Group B.
- Following your field selection, enter a label and a key for the Selector Type you have chosen.
- Label: Used internally for reference.
- Key: Used by the analytics platform reading the data layer; for example, Google Analytics. Ensure these keys are also set as variables within your analytics platform. Refer to your analytics platform documentation for setup details.
- Group Fields by Selector Type: Enable this toggle to organize fields in their respective selector types.
- Send Form Events to the Data Layer: Enable this toggle to allow or disable the sending of form events and form data to the data layer.
- Click Save. The specified fields will be written to the user’s data layer on every page load, provided the Data Layer configuration is set to Enabled.
For data layer event names sent from the out-of-the-box forms and their customer definitions, see Data layer event names and custom definitions.