- 2 Minutes to read
- Print
- DarkLight
Step 3: Initializing the Teaser Elements
- 2 Minutes to read
- Print
- DarkLight
To initialize the teaser elements, you need the object wt_ttv2. You can mark the teaser elements to be measured by adding the configurations to the array wt_ttv2.
The configuration for a teaser element is divided into
selector
shadowRoot
exclude
data
conversion
Example
window.wt_ttv2 = window.wt_ttv2 || [];
window.wt_ttv2.push(
{
selector: "li.item:nth-of-type(2)",
shadowRoot: "#women-collection",
exclude: [
"li.item:nth-of-type(2) a:last-child"
],
data: {
name: "New Women Collection",
rank: "Main Page Banner",
content: "Women Collection",
variant: "campaign"
},
conversion: {
type: "view",
goal: "order",
value: "10%"
}
}
);
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
selector | Enter the teaser element to be measured. You can either pass this directly as HTML element or pass the CSS selector of the element. Within the teaser element, all links, areas, buttons, and input fields of the type "submit" are marked for teaser click tracking. | ||||||||||
shadowRoot | If your teaser element is inside a shadow DOM element, specify the CSS selector of the shadow DOM element. If you have defined a CSS selector as the "selector", it will refer to the "shadowRoot" selector you have defined. | ||||||||||
exclude | Define teaser links or teaser buttons for which no teaser click is to be measured. You can either pass them directly as HTML elements or you can pass the CSS selectors of the element. | ||||||||||
data | Specify the information of the teaser element using the following values:
| ||||||||||
conversion | Specify how the teaser is to be assigned to the conversion or Web page target. You can set the following values:
|