@@ -12,20 +12,20 @@ There are currently three types of events and each has a consistent data format.
12
12
13
13
``` javascript
14
14
{
15
- accountId: ' futuredemodealer' ,
16
- siteId: ' futuredemodealer' ,
17
- defaultDomain: ' www.roimotors.com' ,
18
- indexPage: true ,
19
- searchPage: false ,
20
- detailPage: false ,
21
- franchises: [' honda' ],
22
- design: {
23
- variationId: ' v9_GLOBAL_0011_V2' ,
24
- themekit: ' BLUE_WHITE'
25
- },
26
- pageName: ' INDEX' ,
27
- layoutType: ' desktop' ,
28
- locale: ' en_US'
15
+ accountId: ' futuredemodealer' ,
16
+ siteId: ' futuredemodealer' ,
17
+ defaultDomain: ' www.roimotors.com' ,
18
+ indexPage: true ,
19
+ searchPage: false ,
20
+ detailPage: false ,
21
+ franchises: [' honda' ],
22
+ design: {
23
+ variationId: ' v9_GLOBAL_0011_V2' ,
24
+ themekit: ' BLUE_WHITE'
25
+ },
26
+ pageName: ' INDEX' ,
27
+ layoutType: ' desktop' ,
28
+ locale: ' en_US'
29
29
}
30
30
```
31
31
@@ -49,21 +49,21 @@ Field Key | Example Value | Field Format
49
49
50
50
``` javascript
51
51
{
52
- dealershipName: ' ROI Motors' ,
53
- dealershipAddress1: ' 1 Howard Street' ,
54
- dealershipAddress2: ' ' ,
55
- dealershipCity: ' Burlington' ,
56
- dealershipCodes: {
57
- ' dealertrack-post' : ' futuredemodealer' ,
58
- dtid: ' 12345' ,
59
- ' dt-dr-profile' : ' futuredemodealer' ,
60
- affiliate_promotions: ' avis' ,
61
- ' at-kbb' : ' 12345678'
62
- },
63
- dealershipFranchises: [' honda' ],
64
- dealershipPostalCode: ' 05401' ,
65
- dealershipStateProvince: ' VT' ,
66
- dealershipCountry: ' US'
52
+ dealershipName: ' ROI Motors' ,
53
+ dealershipAddress1: ' 1 Howard Street' ,
54
+ dealershipAddress2: ' ' ,
55
+ dealershipCity: ' Burlington' ,
56
+ dealershipCodes: {
57
+ ' dealertrack-post' : ' futuredemodealer' ,
58
+ dtid: ' 12345' ,
59
+ ' dt-dr-profile' : ' futuredemodealer' ,
60
+ affiliate_promotions: ' avis' ,
61
+ ' at-kbb' : ' 12345678'
62
+ },
63
+ dealershipFranchises: [' honda' ],
64
+ dealershipPostalCode: ' 05401' ,
65
+ dealershipStateProvince: ' VT' ,
66
+ dealershipCountry: ' US'
67
67
}
68
68
```
69
69
@@ -85,60 +85,60 @@ Field Key | Example Value | Field Format
85
85
86
86
``` javascript
87
87
{
88
- accountId: ' futuredemodealer' ,
89
- address: {
90
- accountName: ' ROI Motors' ,
91
- city: ' Burlington' ,
92
- state: ' VT' ,
93
- postalCode: ' 05401' ,
94
- country: ' US'
95
- },
96
- autodataCaId: ' 1234567' ,
97
- bodyStyle: ' SUV' ,
98
- certified: false ,
99
- chromeId: ' 411601' ,
100
- cityFuelEconomy: 28 ,
101
- classification: ' primary' ,
102
- dealerCodes: {
103
- ' dealertrack-post' : ' futuredemodealer' ,
104
- dtid: ' 12345' ,
105
- ' dt-dr-profile' : ' futuredemodealer' ,
106
- affiliate_promotions: ' avis' ,
107
- ' at-kbb' : ' 12345678'
108
- },
109
- driveLine: ' Front-wheel Drive' ,
110
- engine: ' I-4 cyl' ,
111
- engineSize: ' 1.5L' ,
112
- exteriorColor: ' Crystal Black Pearl' ,
113
- finalPrice: 32000 ,
114
- fuelType: ' Regular Unleaded' ,
115
- highestPrice: 34500 ,
116
- highwayFuelEconomy: 34 ,
117
- images: [
118
- ' https://pictures.dealer.com/f/futuredemodealer/1182/0686eb936bd7a4905f751493cc28dcb9x.jpg'
119
- ],
120
- internetPrice: 33000 ,
121
- interiorColor: ' White' ,
122
- inventoryType: ' new' ,
123
- link: ' https://www.roimotors.com/new/Honda/2020-Honda-Accord-burlington-ab119e0e0a0a00f944d6f3031cd34854.htm' ,
124
- make: ' Honda' ,
125
- model: ' CR-V' ,
126
- modelCode: ' RW1H9LKNW' ,
127
- msrp: 34000 ,
128
- odometer: 3 ,
129
- optionCodes: [
130
- ' ABC' ,
131
- ' 123' ,
132
- ' 321'
133
- ],
134
- startingPrice: 34000 ,
135
- status: ' live' ,
136
- stockNumber: ' 00100060' ,
137
- transmission: ' Variable' ,
138
- trim: ' Touring 2WD' ,
139
- uuid: ' ab119e0e0a0a00f944d6f3031cd34854' ,
140
- vin: ' 1HGCV1F42JA141468' ,
141
- year: 2020
88
+ accountId: ' futuredemodealer' ,
89
+ address: {
90
+ accountName: ' ROI Motors' ,
91
+ city: ' Burlington' ,
92
+ state: ' VT' ,
93
+ postalCode: ' 05401' ,
94
+ country: ' US'
95
+ },
96
+ autodataCaId: ' 1234567' ,
97
+ bodyStyle: ' SUV' ,
98
+ certified: false ,
99
+ chromeId: ' 411601' ,
100
+ cityFuelEconomy: 28 ,
101
+ classification: ' primary' ,
102
+ dealerCodes: {
103
+ ' dealertrack-post' : ' futuredemodealer' ,
104
+ dtid: ' 12345' ,
105
+ ' dt-dr-profile' : ' futuredemodealer' ,
106
+ affiliate_promotions: ' avis' ,
107
+ ' at-kbb' : ' 12345678'
108
+ },
109
+ driveLine: ' Front-wheel Drive' ,
110
+ engine: ' I-4 cyl' ,
111
+ engineSize: ' 1.5L' ,
112
+ exteriorColor: ' Crystal Black Pearl' ,
113
+ finalPrice: 32000 ,
114
+ fuelType: ' Regular Unleaded' ,
115
+ highestPrice: 34500 ,
116
+ highwayFuelEconomy: 34 ,
117
+ images: [
118
+ ' https://pictures.dealer.com/f/futuredemodealer/1182/0686eb936bd7a4905f751493cc28dcb9x.jpg'
119
+ ],
120
+ internetPrice: 33000 ,
121
+ interiorColor: ' White' ,
122
+ inventoryType: ' new' ,
123
+ link: ' https://www.roimotors.com/new/Honda/2020-Honda-Accord-burlington-ab119e0e0a0a00f944d6f3031cd34854.htm' ,
124
+ make: ' Honda' ,
125
+ model: ' CR-V' ,
126
+ modelCode: ' RW1H9LKNW' ,
127
+ msrp: 34000 ,
128
+ odometer: 3 ,
129
+ optionCodes: [
130
+ ' ABC' ,
131
+ ' 123' ,
132
+ ' 321'
133
+ ],
134
+ startingPrice: 34000 ,
135
+ status: ' live' ,
136
+ stockNumber: ' 00100060' ,
137
+ transmission: ' Variable' ,
138
+ trim: ' Touring 2WD' ,
139
+ uuid: ' ab119e0e0a0a00f944d6f3031cd34854' ,
140
+ vin: ' 1HGCV1F42JA141468' ,
141
+ year: 2020
142
142
}
143
143
```
144
144
@@ -221,10 +221,10 @@ To receive data for events, you must opt-in to event subscriptions. Each event i
221
221
222
222
``` javascript
223
223
(async APILoader => {
224
- const API = await APILoader .create (document . currentScript );
225
- API .subscribe (' page-load-v1' , ev => {
226
- API .log (ev);
227
- });
224
+ const API = await APILoader .create ();
225
+ API .subscribe (' page-load-v1' , ev => {
226
+ API .log (ev);
227
+ });
228
228
})(window .DDC .APILoader );
229
229
230
230
```
@@ -244,10 +244,10 @@ The page load event is useful to determine the context of the current page. By m
244
244
245
245
``` javascript
246
246
(async APILoader => {
247
- const API = await APILoader .create (document . currentScript );
248
- API .subscribe (' dealership-info-v1' , ev => {
249
- API .log (ev);
250
- });
247
+ const API = await APILoader .create ();
248
+ API .subscribe (' dealership-info-v1' , ev => {
249
+ API .log (ev);
250
+ });
251
251
})(window .DDC .APILoader );
252
252
253
253
```
@@ -267,10 +267,10 @@ The dealership info event is useful if you need to know the name and address of
267
267
268
268
``` javascript
269
269
(async APILoader => {
270
- const API = await APILoader .create (document . currentScript );
271
- API .subscribe (' vehicle-shown-v1' , ev => {
272
- API .log (ev);
273
- });
270
+ const API = await APILoader .create ();
271
+ API .subscribe (' vehicle-shown-v1' , ev => {
272
+ API .log (ev);
273
+ });
274
274
})(window .DDC .APILoader );
275
275
```
276
276
@@ -291,11 +291,11 @@ On a vehicle deals page, a single event is fired because you are viewing a singl
291
291
292
292
``` javascript
293
293
(async APILoader => {
294
- const API = await APILoader .create (document . currentScript );
295
- API .subscribe (' vehicle-data-updated-v1' , data => {
296
- API .log (data .payload .pageData ); // Outputs the Page Data object to the console.
297
- API .log (data .payload .vehicleData ); // Outputs the updated Vehicle Data object to the console.
298
- });
294
+ const API = await APILoader .create ();
295
+ API .subscribe (' vehicle-data-updated-v1' , data => {
296
+ API .log (data .payload .pageData ); // Outputs the Page Data object to the console.
297
+ API .log (data .payload .vehicleData ); // Outputs the updated Vehicle Data object to the console.
298
+ });
299
299
})(window .DDC .APILoader );
300
300
```
301
301
0 commit comments