UNPKG

digitalmarketplace-frontend

Version:

Digital Marketplace Frontend contains assets and components used in Digital Marketplace projects

27 lines (22 loc) 1.08 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.DigitalMarketplaceFrontend = {})); })(this, (function (exports) { 'use strict'; var GrantType; (function (GrantType) { GrantType["GRANTED"] = "granted"; GrantType["NOT_GRANTED"] = "not granted"; })(GrantType || (GrantType = {})); const getGrantedText = (state) => state ? GrantType.GRANTED : GrantType.NOT_GRANTED; const updateDataLayer = (cookiePreferences) => { window.dataLayer.push({ event: 'gtm_consent_update', usage_consent: getGrantedText(cookiePreferences.usage), glassbox_consent: getGrantedText(cookiePreferences.glassbox), marketing_consent: GrantType.NOT_GRANTED }); }; exports.updateDataLayer = updateDataLayer; })); //# sourceMappingURL=data-layer.bundle.js.map