UNPKG

@teamsparta/cross-platform-logger

Version:

```typescript import * as CPL from "@teamsparta/cross-platform-logger";

21 lines 631 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sendGTM = void 0; var sendGTM = function (key, data, attempt) { if (attempt === void 0) { attempt = 0; } if (typeof window.dataLayer === 'undefined') { if (attempt >= 10) { return; } return setTimeout(function () { return (0, exports.sendGTM)(key, data, attempt + 1); }, 300); } try { data["event"] = key; window.dataLayer.push(data); } catch (error) { console.error("send gtm error: ", error); } }; exports.sendGTM = sendGTM; //# sourceMappingURL=gtm.js.map