airport-one-embeddable-widgets 2.16.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,6 +36,8 @@ You can customize the behavior and appearance of the element by setting its attr
36
36
  | departureAirportLabel | string | null | The label for the departure airport input |
37
37
  | departureDateLabel | string | null | The label for the departure date input |
38
38
  | returnDateLabel | string | null | The label for the return date input |
39
+ | consentAdvertising | string | null | Dynamically turn off/on consent for Advertising - by passing a "true" or "false" |
40
+ | consentAnalytics | string | null | Dynamically turn off/on consent for Analytics - by passing a "true" or "false" |
39
41
 
40
42
  ## Examples
41
43
 
@@ -208,3 +210,27 @@ flight-search-form::part(flight-search-widget-search-button-svg) {
208
210
  fill: #fff;
209
211
  }
210
212
  ```
213
+
214
+ # Consent Management
215
+
216
+ ## How to dynamically manage user consent preferences and pass them into the widget
217
+
218
+ There are two consent categories that can optionally be turned off/on via DOM manipulation and modifying attributes on the widget.
219
+
220
+ ```javascript
221
+ <flight-search-form origin="JFK" destination="LAX"></flight-search-form>
222
+
223
+ ...
224
+
225
+ // Call a similar function via your CMP integration to pass in the consent values for Analytics or Advertising
226
+ function changeConsent(consentAdvertising, consentAnalytics) {
227
+ // Select the flightWidget element
228
+ var flightWidget = document.getElementsByTagName('flight-search-form');
229
+
230
+ // Set user's advertising consent from CMP
231
+ flightWidget.setAttribute('consentAdvertising', consentAdvertising); // consentAdvertising param should be a string of "true" or "false"
232
+
233
+ // Set user's analytics consent from CMP
234
+ flightWidget.setAttribute('consentAnalytics', 'true') // consentAnalytics param should be a string of "true" or "false"
235
+ }
236
+ ```