matelso logo 2022 brand
matelso logo 2022 brand
View Categories

matelso DataLayer – send your own values to matelso

1 min read

The information for sending via the matelso integration system is available in the matelso DataLayer. Our customers can also send their own information to the DataLayer.

 

How can I insert data into the DataLayer? #

Once the matelso snippet is embedded on your website, you can insert data into the Datalayer. The matelso data layer takes a javascript object as a parameter. In this object, you can access the top-level properties. If this object contains child objects or arrays, they cannot be accessed.

If you want to transfer objects or arrays, you can send them as JSON or unpack the object.

 

The following snippet inserts data into the Matelso data layer: #

if(mtls.loaded) {
window[window.CallTrackingObject]("addCustomTrackingValues", { prop1: 'wert1', prop2: 15, prop3: '{}' });
}

In the first line of this snippet, we open an “if” block to check whether the matelso S&R library is loaded and ready. This block is closed again in line 3.

In line 2 we send an object “{ prop1: ‘value1’, prop2: 15, prop3: ‘{}’ }” to the Matelso data layer. This object contains 3 properties (prop1,prop2,prop3).

 

How can I use the data from the data layer? #

Data in the matelso DataLayer can be used anywhere the DDD can be accessed. This includes Integrations 2.0 and Call Messaging (2.0). The DDD key for the DataLayer starts with “webData.custom” and is followed by the property name prop1/2/3 “webData.custom.prop1”.
This key is then followed by an attribution and, if desired, a modifier.

Example without modifier: webData.custom.prop1.attribution(LASTNOTEMPTY)
Example with modifier: webData.custom.prop1.attribution(LASTNOTEMPTY).fallBackValue(empty)