You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/includes/_methods.md
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,11 @@ Parameter Name | Purpose | Field Format
47
47
48
48
This method acts as an event subscription, so as the application displays new vehicles dynamically (a single page application), new events are fired and `setupFunction` is automatically called for each of those new items. This works well for a basic use case where you want to place content on every item having the target location, or every item matching specific criteria available to you in the `setupFunction` payload. If you need to execute intermediary code before determining if you need to insert content, such as calling an external service, you should use the <ahref="#api-insertcalltoactiononce-type-intent-settingsfunction-meta">`insertCallToActionOnce`</a> method instead.
49
49
50
-
The default location for a CTA is the bottom of the existing CTA area on vehicle search results and details pages.
50
+
The default location for a CTA is the bottom of the existing CTA list on vehicle search results and details pages.
However, by using this method it enables Dealer.com to specify the location of your CTA in the list and even map it to "take over" an existing CTA. For example, if a dealer has a custom styled E-Price button and wants your CTA to replace the standard functionality for that feature on their site, we can map your CTA to replace the default functionality. If your code fails to load for some reason, the default behavior of that button still takes effect and ensures that site users can still submit leads, etc.
54
+
However, by using this method it enables Dealer.com to reorder the location of your CTA in the list and even map it to "take over" an existing CTA. For example, if a dealer has a custom styled E-Price button and wants your CTA to replace the standard functionality for that feature on their site, we can map your CTA to replace the default functionality. If your code fails to load for some reason, the default behavior of that button still takes effect and ensures that site users can still submit leads, etc.
55
55
56
56
### CTA Type
57
57
@@ -192,28 +192,34 @@ This acts as an event subscription, so as the application displays new vehicles
192
192
193
193
```javascript
194
194
(function(WIAPI) {
195
+
196
+
// Initialize an instance of the API
195
197
varAPI=newWIAPI('test-integration');
198
+
199
+
// Receive a notification whenever vehicle data is updated on the page (or a new page is loaded).
API.log("Skipping vehicle "+meta.vin+" because it does not have service data.");
219
225
}
@@ -222,6 +228,7 @@ This acts as an event subscription, so as the application displays new vehicles
222
228
});
223
229
});
224
230
})(window.DDC.API);
231
+
225
232
```
226
233
227
234
You may prefer to only insert content when you are ready, after performing other functions. For example, if you need to make a service call to your system with a list of vehicles to determine which ones have data on your side, and only then decorate specific vehicles with appropriate content. With `insertOnce`, the method behaves as a functional insert which can be chained with other functions, and does not behave as a subscription. With `API.insertOnce`, you will need to invoke it inside of a <ahref="#vehicle-data-updated-v1">`vehicle-data-updated-v1`</a> subscription so that your code is triggered each time the list of vehicles is loaded on a page rather than only the first time.
0 commit comments