-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathw3c-data-object.js
57 lines (50 loc) · 1.27 KB
/
w3c-data-object.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// W3C format example
window.digitalData = {
pageInstanceID: "Home-Production",
page: {
pageInfo: {
pageID: "home",
destinationURL: "http://www.vodacom.co.za/personal/main/home"
},
category: {
primaryCategory: "personal",
subCategory1: "main",
pageType: "content"
},
attributes: {
market: "ZA"
}
},
user: [{
attributes: {
login_status: "logged Out"
}
}]
};
// Tealium data layer format example
window.utag_data = window.utag_data || {};
utag_data.page_name = "home";
utag_data.page_channel = "main";
utag_data.visitor_login_status = "logged Out";
// Additional data points set inside Tealium utag.js code
// page_market is set to a fixed value in utag.js
// page_channel is set from window.bookname
// page_master_tab is scraped from window.globalPortalContextPath
// page_type is set by a lookup from window.bookname
// Ecommerce example
digitalData.cart.price = {
basePrice: 200.00,
currency: "EUR",
cartTotal: 125
};
// Event example
digitalData.event[n].eventInfo = {
eventName: "Form started",
type: "form",
eventAction: "started",
attributes: {
form_name: "new customer details"
}
};
utag_data[ eventInfo.type + "_event" ] = eventInfo.eventAction;
utag_data["visitor_event"] = "login";