Analytics¶
Introduction¶
Analytics is implemented by using GTM (Google Tag Manager). Parameters are pushed to a Data Layer object used by GTM, some parameters are always available and others only at certain steps in Tulo Shop Events are pushed to the Data Layer when the end user navigates and e.g. proceeds with the purchase, step by step
Custom GTM Container
If you have an existing GTM container that you would like to use, or if you want to target a specific GTM container, please contact Adeprimo to have this configured for your shop.
Data Layer object¶
The Data Layer object contains the following information, 4 top level properties as objects. These can be accessed in GTM using Data Layer Variables.
Top level properties¶
| Properties | Explanation |
|---|---|
| general | General information about the shop, organisation, title in Payway, certain step/page etc |
| product | Product beeing shown/purchased. Available when user has selected a campaign or package for purchase |
| account | Account information from Payway. Available when the user is logged in. |
| order | Order information. Available when a purchase is completed or has failed, general.pageCategory=confirmation. |
Data Layer, initial data after page load from server side¶
dataLayer = [
{
"general": {
"pageName": "MARKETPLACE",
"pageUrl": "some-group-key/some-marketplace-key", // the path to the shop (group and marketplace keys in Payway)
"pageCategory": "marketplace", // see possible values below!
"organisation": "", // organisation id, same as in Payway
// The following parameters are received as query parameters in the original url to the shop
"title": "", // from tc/accountOrigin query parameter, see query parameter note below!
"accountOrigin": "",
"returnUrl": "",
"articleId": "",
"paywallId": ""
},
"product": {
"productCode": "",
"productName": "",
"isCampaign": true | false,
"tags": [],
"title": ""
},
"account": {
"accountId": "",
"zipCode": "",
"city": ""
},
"order": {
// The following parameters are received as query parameters in the original url to the shop
// see query parameter note below!
"trafficSource": "",
"merchantReference": ""
}
}
];
Query Parameters
More information about supported query parameters, see here
Data Layer, additional data added after steps are completed¶
general¶
these are updated when a package/campaign has been selected/is browsed
{
"title": ""
}
product¶
these are updated when a package/campaign has been selected/is browsed
{
"productCode": "",
"productName": "",
"isCampaign": true | false,
"tags": [],
"title": "" // package/campaign title code in Payway
}
account¶
if the customer is logged in, accountId is set. If the customers address is saved in Payway, the zipCode and city parameters will be set
{
"accountId": "",
"zipCode": "",
"city": ""
}
order¶
{
"orderId": "", // Payway order id, e.g. ORGANISATION-12345
"price": number, // Price paid for the first period
"period": { "length": number, "type": "day | week | month | year" },
"paymentMethod": "", // Purchased with payment method, e.g. adyen_scheme. See Payway docs!
"subscriptionType": "limited | recurring",
"status": "complete | failed | pending | ?",
// optional
"paywallId": "", // from query parameter "pid" in the original url when navigating to Tulo Shop
"trustedIdentity": true | false, // if TrustedIdentity was used to complete the order, invoice for Finnish customers only!?
// always set on initial page load (available before order is completed/failed)
"trafficSource": "", // from query parameter...
"merchantReference": "" // from query parameter...
}
general.pageName (possible values)¶
| pageName | Description |
|---|---|
| MARKETPLACE | Where several packages are presented, "entry page" from Payway admin link |
| MARKETPLACE_SHOP | When a campaign/package has been chosen |
| MARKETPLACE_SHOP_CONFIRMATION | When a purchase has been completed or has failed |
general.pageCategory (possible values)¶
| pageCategory | Description |
|---|---|
| marketplace | Marketplace overview page |
| shop | A purchase flow page initializes (awaits that product info has loaded and customer is possibly logged in) |
| shop_step1_complete | Address/account information step completed |
| shop_step3_complete | Payment step completed |
| shop_redeem_voucher | Redeem voucher page initializes |
| shop_requestpasswordreset | Reset password page loads |
| shop_completepasswordreset | Complete password reset page loads |
| express_checkout | Express checkout product loads |
| confirmation | Order confirmation page |
GTM Events¶
All GTM events are pushed to window.dataLayer. There are two main event types:
- pageView — pushes
{ event: 'pageView' }(optionally withengage.customData) - Named events — pushes
{ event: 'engage.dp.init', 'engage.track': <eventName> }(optionally withengage.customData)
Additionally, data layer updates (product, account, order, page metadata) are pushed to enrich the context for subsequent events.
Page View Events¶
A pageView event is sent when:
- The marketplace initially loads
- An order confirmation page is displayed
- Any page category update occurs (each
general.pageCategorychange triggers a newpageView)
Named Events¶
| Event Name | Custom Data | Trigger |
|---|---|---|
account.registration.complete |
— | Successful account registration |
account.registration.failed |
{ status: "unknown" } |
Account registration failure |
account.login.complete |
— | Successful login |
account.login.failed |
{ status: <errorCode> } or { status: "invalid_credentials" } |
Login failure |
account.passwordreset.requested |
— | Password reset email sent successfully |
account.passwordreset.completed |
— | Password reset completed successfully |
purchase.payment.error |
— | Payment processing fails |
purchase.prevalidate.failed |
{ reason: <reason> } |
Pre-purchase validation fails |