@schibsted/pulse-sdk 8.0.0-rc.10 → 8.0.0-rc.12
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/dist/cjs/Tracker.js +137 -115
- package/dist/cjs/app-integration.js +3 -3
- package/dist/cjs/builders/actor.js +3 -3
- package/dist/cjs/builders/consents.js +6 -6
- package/dist/cjs/builders/device-browser.js +8 -8
- package/dist/cjs/builders/device-node.js +3 -3
- package/dist/cjs/builders/events-anonymous-node.js +3 -3
- package/dist/cjs/builders/events-node.js +4 -4
- package/dist/cjs/builders/experimentMetadata.js +2 -2
- package/dist/cjs/builders/objects/objects-anonymous-browser.js +2 -2
- package/dist/cjs/builders/objects/objects-anonymous-node.js +9 -9
- package/dist/cjs/builders/objects/objects-browser.js +2 -2
- package/dist/cjs/builders/objects/objects-node.js +10 -10
- package/dist/cjs/builders/objects/utils.js +3 -3
- package/dist/cjs/builders/origin-browser.js +2 -2
- package/dist/cjs/builders/origin-node.js +4 -4
- package/dist/cjs/builders/session-browser.js +5 -5
- package/dist/cjs/cis-sync/cis-browser.js +219 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/cis.js +0 -1
- package/dist/cjs/cis-sync/eventEmitter.js +37 -0
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/index.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/pulse-cookie.js +53 -63
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/cis-sync}/storage/pulseStorage.js +15 -18
- package/dist/cjs/cis-sync/storage/storage.js +24 -0
- package/dist/cjs/createPulseTracker.js +4 -4
- package/dist/cjs/identity/actor.js +3 -3
- package/dist/cjs/identity/advertising.js +1 -1
- package/dist/cjs/identity/cis.js +5 -5
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/leaveTracking/index.js +10 -10
- package/dist/cjs/leaveTrackingTpaas/index.js +7 -7
- package/dist/cjs/network-browser.js +3 -3
- package/dist/cjs/remoteConfig/index.js +5 -5
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/catalogVersion.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/device.js +2 -2
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/navigationType.js +2 -3
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageInfo.js +2 -2
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/provider.js +3 -1
- package/dist/cjs/tpaas-builders/builders/referrer.js +17 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/session.js +6 -6
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/user.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/utm.js +3 -3
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders.js +7 -7
- package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/guards.js +1 -1
- package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/constants.js +79 -124
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/cjs/tpaas-schemas}/types.js +0 -1
- package/dist/cjs/tracker-proxy/proxy-provider.js +2 -2
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrapper/utils/map-page-to-page-ref.js +13 -0
- package/dist/ejs/Tracker.js +63 -41
- package/dist/ejs/app-integration.js +1 -1
- package/dist/ejs/builders/actor.js +1 -1
- package/dist/ejs/builders/consents.js +2 -2
- package/dist/ejs/builders/device-browser.js +2 -2
- package/dist/ejs/builders/device-node.js +1 -1
- package/dist/ejs/builders/events-anonymous-node.js +1 -1
- package/dist/ejs/builders/events-node.js +1 -1
- package/dist/ejs/builders/experimentMetadata.js +1 -1
- package/dist/ejs/builders/objects/objects-anonymous-browser.js +1 -1
- package/dist/ejs/builders/objects/objects-anonymous-node.js +1 -1
- package/dist/ejs/builders/objects/objects-browser.js +1 -1
- package/dist/ejs/builders/objects/objects-node.js +1 -1
- package/dist/ejs/builders/objects/utils.js +1 -1
- package/dist/ejs/builders/origin-browser.js +1 -1
- package/dist/ejs/builders/origin-node.js +1 -1
- package/dist/ejs/builders/session-browser.js +1 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis-browser.js +1 -2
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/cis.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/eventEmitter.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/index.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/pulse-cookie.js +1 -2
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/pulseStorage.js +0 -1
- package/{node_modules/@schibsted/pulse-cis-sync/dist/ejs → dist/ejs/cis-sync}/storage/storage.js +1 -2
- package/dist/ejs/createPulseTracker.js +1 -1
- package/dist/ejs/identity/actor.js +2 -2
- package/dist/ejs/identity/advertising.js +1 -1
- package/dist/ejs/identity/cis.js +2 -2
- package/dist/ejs/index.js +4 -3
- package/dist/ejs/leaveTracking/index.js +1 -1
- package/dist/ejs/leaveTrackingTpaas/index.js +1 -1
- package/dist/ejs/network-browser.js +1 -1
- package/dist/ejs/remoteConfig/index.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/catalogVersion.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/device.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/navigationType.js +2 -3
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageInfo.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/provider.js +3 -1
- package/dist/ejs/tpaas-builders/builders/referrer.js +13 -0
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/session.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/user.js +1 -1
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/utm.js +2 -2
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders.js +7 -7
- package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/guards.js +1 -1
- package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/constants.js +77 -122
- package/dist/ejs/tracker-proxy/proxy-provider.js +1 -1
- package/dist/ejs/version.js +1 -1
- package/dist/ejs/wrapper/utils/map-page-to-page-ref.js +10 -0
- package/dist/types/Tracker.d.ts +19 -5
- package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/storage/storage.d.ts +1 -1
- package/dist/types/identity/actor.d.ts +1 -1
- package/dist/types/identity/advertising.d.ts +2 -2
- package/dist/types/identity/cis.d.ts +3 -3
- package/dist/types/index.d.ts +4 -4
- package/dist/types/leaveTrackingTpaas/index.d.ts +1 -1
- package/dist/types/leaveTrackingTpaas/types.d.ts +1 -1
- package/dist/types/tpaas-builders/builders/anonymous.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/baseEvent.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/catalogVersion.d.ts +3 -0
- package/dist/types/tpaas-builders/builders/consents.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/device.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/experiments.d.ts +9 -0
- package/dist/types/tpaas-builders/builders/navigationType.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageInfo.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/pageviewId.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/provider.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/referrer.d.ts +6 -0
- package/dist/types/tpaas-builders/builders/session.d.ts +15 -0
- package/dist/types/tpaas-builders/builders/time.d.ts +4 -0
- package/dist/types/tpaas-builders/builders/trackerBuilder.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/user.d.ts +5 -0
- package/dist/types/tpaas-builders/builders/utm.d.ts +6 -0
- package/dist/types/tpaas-builders/builders.d.ts +122 -0
- package/dist/types/tpaas-builders/guards.d.ts +2 -0
- package/dist/types/tpaas-builders/index.d.ts +3 -0
- package/dist/types/tpaas-builders/types.d.ts +30 -0
- package/dist/types/tpaas-schemas/constants.d.ts +360 -0
- package/dist/types/tpaas-schemas/index.d.ts +5 -0
- package/dist/types/tpaas-schemas/types/ITpaasEvent.d.ts +98 -0
- package/dist/types/tpaas-schemas/types/schemas/IAnonymousViewUIElement.d.ts +58 -0
- package/dist/types/tpaas-schemas/types/schemas/ICompletedHealthAction.d.ts +144 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementAudio.d.ts +227 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementForm.d.ts +111 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementHealthUIElement.d.ts +138 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementOffer.d.ts +107 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementTeaser.d.ts +103 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementUIElement.d.ts +101 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideo.d.ts +253 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementVideoAd.d.ts +153 -0
- package/dist/types/tpaas-schemas/types/schemas/IEngagementWidget.d.ts +91 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionAdSlot.d.ts +89 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionForm.d.ts +113 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionHealthUIElement.d.ts +143 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionOffer.d.ts +109 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionPlayer.d.ts +104 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionTeaser.d.ts +101 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionUIElement.d.ts +107 -0
- package/dist/types/tpaas-schemas/types/schemas/IImpressionWidget.d.ts +89 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveArticle.d.ts +131 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveAudioPage.d.ts +88 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveError.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveFrontpage.d.ts +83 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLandingpage.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveListing.d.ts +114 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedArticle.d.ts +139 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedAudioPage.d.ts +97 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveLockedVideoPage.d.ts +97 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeavePage.d.ts +82 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveSportsPage.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveVideoPage.d.ts +91 -0
- package/dist/types/tpaas-schemas/types/schemas/ILeaveWeather.d.ts +94 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewArticle.d.ts +131 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewAudioPage.d.ts +87 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewError.d.ts +90 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewFrontpage.d.ts +80 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewHealthPage.d.ts +124 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLandingpage.d.ts +76 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewListing.d.ts +109 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedArticle.d.ts +139 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedAudioPage.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewLockedVideoPage.d.ts +95 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewPage.d.ts +86 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewSportsPage.d.ts +88 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewTitle.d.ts +92 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewVideoPage.d.ts +87 -0
- package/dist/types/tpaas-schemas/types/schemas/IViewWeather.d.ts +94 -0
- package/dist/types/tpaas-schemas/types/schemas/index.d.ts +47 -0
- package/dist/types/tpaas-schemas/types/templates/IConsents.d.ts +34 -0
- package/dist/types/tpaas-schemas/types/templates/IContent.d.ts +56 -0
- package/dist/types/tpaas-schemas/types/templates/IDevice.d.ts +62 -0
- package/dist/types/tpaas-schemas/types/templates/IEngagement.d.ts +21 -0
- package/dist/types/tpaas-schemas/types/templates/IExperiments.d.ts +35 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthFood.d.ts +55 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthOrigin.d.ts +27 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthPhysicalActivity.d.ts +36 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthTraining.d.ts +70 -0
- package/dist/types/tpaas-schemas/types/templates/IHealthUserData.d.ts +25 -0
- package/dist/types/tpaas-schemas/types/templates/ILeave.d.ts +54 -0
- package/dist/types/tpaas-schemas/types/templates/ILeaveAudio.d.ts +37 -0
- package/dist/types/tpaas-schemas/types/templates/ILeaveStories.d.ts +44 -0
- package/dist/types/tpaas-schemas/types/templates/ILocation.d.ts +21 -0
- package/dist/types/tpaas-schemas/types/templates/IMetrics.d.ts +32 -0
- package/dist/types/tpaas-schemas/types/templates/IPageRef.d.ts +41 -0
- package/dist/types/tpaas-schemas/types/templates/IPlacement.d.ts +45 -0
- package/dist/types/tpaas-schemas/types/templates/IProvider.d.ts +73 -0
- package/dist/types/tpaas-schemas/types/templates/ISession.d.ts +33 -0
- package/dist/types/tpaas-schemas/types/templates/ISports.d.ts +150 -0
- package/dist/types/tpaas-schemas/types/templates/ITime.d.ts +32 -0
- package/dist/types/tpaas-schemas/types/templates/ITracker.d.ts +43 -0
- package/dist/types/tpaas-schemas/types/templates/IUser.d.ts +34 -0
- package/dist/types/tpaas-schemas/types/templates/IUtmTags.d.ts +40 -0
- package/dist/types/tpaas-schemas/types/templates/index.d.ts +24 -0
- package/dist/types/tpaas-schemas/types.d.ts +42 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wrapper/engagement/ui-element/types.d.ts +1 -1
- package/dist/types/wrapper/types/base-event.d.ts +1 -1
- package/dist/types/wrapper/types/event.d.ts +1 -1
- package/dist/types/wrapper/types/utils.d.ts +1 -1
- package/dist/types/wrapper/utils/map-page-to-page-ref.d.ts +3 -0
- package/dist/types/wrapper/view/article/types.d.ts +1 -1
- package/dist/types/wrapper/view/frontpage/types.d.ts +1 -1
- package/dist/types/wrapper/view/listing/types.d.ts +1 -1
- package/dist/types/wrapper/view/loginposter/types.d.ts +1 -1
- package/dist/types/wrapper/view/page/types.d.ts +1 -1
- package/dist/types/wrapper/view/salesposter/types.d.ts +1 -1
- package/dist/types/wrapper/view/ui-element/types.d.ts +1 -1
- package/package.json +20 -20
- package/dist/cjs/Tracker.test-d.js +0 -76
- package/dist/ejs/Tracker.test-d.js +0 -71
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js +0 -287
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis-browser.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/cis.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js +0 -39
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/eventEmitter.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/index.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/pulse-cookie.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/pulseStorage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js +0 -26
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/storage/storage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/cjs/types.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.d.ts +0 -27
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis-browser.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.d.ts +0 -10
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/cis.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.d.ts +0 -14
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/eventEmitter.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.d.ts +0 -4
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/index.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.d.ts +0 -55
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/pulse-cookie.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.d.ts +0 -40
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/pulseStorage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.d.ts +0 -7
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/storage/storage.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.d.ts +0 -24
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js +0 -2
- package/node_modules/@schibsted/pulse-cis-sync/dist/ejs/types.js.map +0 -1
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis-browser.d.ts +0 -27
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/cis.d.ts +0 -10
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/eventEmitter.d.ts +0 -14
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/index.d.ts +0 -4
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/pulse-cookie.d.ts +0 -55
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/pulseStorage.d.ts +0 -40
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/storage/storage.d.ts +0 -7
- package/node_modules/@schibsted/pulse-cis-sync/dist/types/types.d.ts +0 -24
- package/node_modules/@schibsted/pulse-cis-sync/package.json +0 -44
- package/node_modules/@schibsted/pulse-utils/package.json +0 -36
- package/node_modules/@schibsted/tpaas-event-builder/dist/cjs/builders/referrer.js +0 -19
- package/node_modules/@schibsted/tpaas-event-builder/dist/ejs/builders/referrer.js +0 -15
- package/node_modules/@schibsted/tpaas-event-builder/dist/index.d.ts +0 -5774
- package/node_modules/@schibsted/tpaas-event-builder/package.json +0 -41
- package/node_modules/@schibsted/tpaas-schemas/dist/index.d.ts +0 -6542
- package/node_modules/@schibsted/tpaas-schemas/package.json +0 -35
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/cis-sync}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/anonymous.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/baseEvent.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/consents.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/experiments.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/pageviewId.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/time.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/builders/trackerBuilder.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/cjs → dist/cjs/tpaas-builders}/index.js +0 -0
- /package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-builders}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-schemas/dist/cjs → dist/cjs/tpaas-schemas}/index.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie-config.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/cookie.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/events.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/get.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/getRootDomain.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/index.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/merge.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/objects.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/omit.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/randomString.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/throttle.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/cjs → dist/cjs/utils}/webApi.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/cis-sync}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/anonymous.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/baseEvent.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/consents.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/experiments.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/pageviewId.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/time.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/builders/trackerBuilder.js +0 -0
- /package/{node_modules/@schibsted/tpaas-event-builder/dist/ejs → dist/ejs/tpaas-builders}/index.js +0 -0
- /package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-builders}/types.js +0 -0
- /package/{node_modules/@schibsted/tpaas-schemas/dist/ejs → dist/ejs/tpaas-schemas}/index.js +0 -0
- /package/dist/{types/Tracker.test-d.d.ts → ejs/tpaas-schemas/types.js} +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie-config.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/cookie.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/events.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/get.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/getRootDomain.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/index.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/merge.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/objects.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/omit.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/randomString.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/throttle.js +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/ejs → dist/ejs/utils}/webApi.js +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/cis-browser.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/cis.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/eventEmitter.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/index.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/pulse-cookie.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/storage/pulseStorage.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-cis-sync/dist/cjs → dist/types/cis-sync}/types.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie-config.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/cookie.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/events.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/get.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/getRootDomain.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/index.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/merge.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/objects.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/omit.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/randomString.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/throttle.d.ts +0 -0
- /package/{node_modules/@schibsted/pulse-utils/dist/types → dist/types/utils}/webApi.d.ts +0 -0
package/dist/cjs/Tracker.js
CHANGED
|
@@ -41,10 +41,6 @@ exports.subscribe = subscribe;
|
|
|
41
41
|
exports.subscribeOnce = subscribeOnce;
|
|
42
42
|
exports.subscribeWithState = subscribeWithState;
|
|
43
43
|
exports.unsubscribe = unsubscribe;
|
|
44
|
-
const pulse_cis_sync_1 = require("@schibsted/pulse-cis-sync");
|
|
45
|
-
const pulse_utils_1 = require("@schibsted/pulse-utils");
|
|
46
|
-
const tpaas_event_builder_1 = require("@schibsted/tpaas-event-builder");
|
|
47
|
-
const tpaas_schemas_1 = require("@schibsted/tpaas-schemas");
|
|
48
44
|
const loglevel_1 = __importDefault(require("loglevel"));
|
|
49
45
|
const uuid_1 = require("uuid");
|
|
50
46
|
const app_integration_1 = require("./app-integration");
|
|
@@ -55,6 +51,7 @@ const events_1 = require("./builders/events");
|
|
|
55
51
|
const events_anonymous_node_1 = require("./builders/events-anonymous-node");
|
|
56
52
|
const experiments_1 = require("./builders/experiments");
|
|
57
53
|
const session_browser_1 = require("./builders/session-browser");
|
|
54
|
+
const cis_sync_1 = require("./cis-sync");
|
|
58
55
|
const config_1 = require("./config");
|
|
59
56
|
const config_browser_1 = require("./config-browser");
|
|
60
57
|
const defer_1 = __importDefault(require("./defer"));
|
|
@@ -64,12 +61,16 @@ const leaveTracking_1 = require("./leaveTracking");
|
|
|
64
61
|
const leaveTrackingTpaas_1 = require("./leaveTrackingTpaas");
|
|
65
62
|
const network_1 = __importDefault(require("./network"));
|
|
66
63
|
const config = __importStar(require("./remoteConfig"));
|
|
64
|
+
const tpaas_builders_1 = require("./tpaas-builders");
|
|
65
|
+
const tpaas_schemas_1 = require("./tpaas-schemas");
|
|
67
66
|
const proxy_provider_1 = require("./tracker-proxy/proxy-provider");
|
|
67
|
+
const utils_1 = require("./utils");
|
|
68
68
|
const version_1 = require("./version");
|
|
69
69
|
const visibility_observer_1 = require("./visibility-observer");
|
|
70
70
|
const warnOnce_1 = __importDefault(require("./warnOnce"));
|
|
71
71
|
const event_builder_1 = require("./wrapper/engagement/ui-element/event-builder");
|
|
72
72
|
const types_1 = require("./wrapper/types");
|
|
73
|
+
const map_page_to_page_ref_1 = require("./wrapper/utils/map-page-to-page-ref");
|
|
73
74
|
const page_from_page_view_1 = require("./wrapper/utils/page-from-page-view");
|
|
74
75
|
const event_builder_2 = require("./wrapper/view/article/event-builder");
|
|
75
76
|
const event_builder_3 = require("./wrapper/view/frontpage/event-builder");
|
|
@@ -160,17 +161,11 @@ function unsubscribe(eventName, callback) {
|
|
|
160
161
|
*/
|
|
161
162
|
class Tracker {
|
|
162
163
|
async getCurrentTpaasPage() {
|
|
163
|
-
const { id, type, url } = await this.
|
|
164
|
-
return
|
|
165
|
-
// remove the SDRN prefix, it's not expected for TPaaS
|
|
166
|
-
pageId: id.startsWith('sdrn:') ? id.split(':').slice(-1)[0] : id,
|
|
167
|
-
// make sure the pageType is valid for TPaaS
|
|
168
|
-
pageType: (0, tpaas_event_builder_1.isPageType)(type) ? type : 'Page',
|
|
169
|
-
url,
|
|
170
|
-
};
|
|
164
|
+
const { id, type, url } = await this.currentPageInfo;
|
|
165
|
+
return (0, map_page_to_page_ref_1.mapPageToPageRef)(id, type, url);
|
|
171
166
|
}
|
|
172
167
|
async getCurrentLegacyPage() {
|
|
173
|
-
const { id, type, url } = await this.
|
|
168
|
+
const { id, type, url } = await this.currentPageInfo;
|
|
174
169
|
// make sure the pageType is valid for legacy events
|
|
175
170
|
const validatedType = (0, types_1.isLegacyPageType)(type) ? type : 'Page';
|
|
176
171
|
return {
|
|
@@ -205,10 +200,32 @@ class Tracker {
|
|
|
205
200
|
* As a single source of truth for the current page, this needs to be compatible between legacy and TPaaS events, hence the need for a custom data type.
|
|
206
201
|
* Legacy events can provide an id with SDRN, while TPaaS events don't need it
|
|
207
202
|
*/
|
|
208
|
-
this.
|
|
203
|
+
this.currentPageInfo = {
|
|
209
204
|
id: 'unknown',
|
|
210
205
|
type: 'Page',
|
|
211
|
-
url:
|
|
206
|
+
url: utils_1.isBrowser ? window.location.href : undefined,
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* @private
|
|
210
|
+
*
|
|
211
|
+
* This is used as the source of truth for the current page's referrer information, which is updated based on the View Page-level event
|
|
212
|
+
* !! This is only used in TPaaS events and contexts, as we don't want to risk changing the behaviour of legacy events
|
|
213
|
+
* This is also the reason this is being kept as a separate variable from the currentPageInfo property,
|
|
214
|
+
* which is used for both legacy and TPaaS events
|
|
215
|
+
*/
|
|
216
|
+
this.currentPageReferrer = {
|
|
217
|
+
url: utils_1.isBrowser ? document.referrer || undefined : undefined,
|
|
218
|
+
};
|
|
219
|
+
this.setCurrentTpaasPageData = (id, type, referrer) => {
|
|
220
|
+
this.currentPageInfo = {
|
|
221
|
+
id: id || 'unknown',
|
|
222
|
+
type: type || 'Page',
|
|
223
|
+
url: utils_1.isBrowser ? window.location.href : undefined,
|
|
224
|
+
};
|
|
225
|
+
this.currentPageReferrer = {
|
|
226
|
+
...referrer,
|
|
227
|
+
url: referrer?.url ?? (utils_1.isBrowser ? document.referrer || undefined : undefined),
|
|
228
|
+
};
|
|
212
229
|
};
|
|
213
230
|
/**
|
|
214
231
|
* Promise that resolves when a session ID becomes available
|
|
@@ -221,19 +238,13 @@ class Tracker {
|
|
|
221
238
|
*/
|
|
222
239
|
this.hasProxyListener = false;
|
|
223
240
|
this.setPageDefaults = (pageViewEvent) => {
|
|
224
|
-
this.
|
|
241
|
+
this.currentPageInfo = (0, page_from_page_view_1.pageFromPageView)(pageViewEvent);
|
|
242
|
+
this.currentPageReferrer = Promise.resolve(pageViewEvent.origin).then((originProperties) => (0, map_page_to_page_ref_1.mapPageToPageRef)(originProperties?.id, originProperties?.type, originProperties?.url));
|
|
225
243
|
if (pageViewEvent.origin) {
|
|
226
244
|
const pageDefaults = { origin: pageViewEvent.origin };
|
|
227
245
|
this.update(pageDefaults, true);
|
|
228
246
|
}
|
|
229
247
|
};
|
|
230
|
-
this.setCurrentPage = (id, type) => {
|
|
231
|
-
this.currentPage = {
|
|
232
|
-
id: id || 'unknown',
|
|
233
|
-
type: type || 'Page',
|
|
234
|
-
url: pulse_utils_1.isBrowser ? window.location.href : undefined,
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
248
|
loglevel_1.default.setLevel(config?.logLevel ?? loglevel_1.default.levels.ERROR);
|
|
238
249
|
// runtime check for providerId inconsistency
|
|
239
250
|
if (!providerId || !(typeof providerId === 'string')) {
|
|
@@ -243,13 +254,13 @@ class Tracker {
|
|
|
243
254
|
throw new Error('`componentVersion` cannot be provided without `component`');
|
|
244
255
|
}
|
|
245
256
|
let includeAdvertising;
|
|
246
|
-
if (
|
|
257
|
+
if (utils_1.isBrowser && config?.autoCreateConsents) {
|
|
247
258
|
config.consents = (0, consent_manager_1.getConsentsWaitForAnalytics)((consents) => {
|
|
248
259
|
loglevel_1.default.debug('Consents received from CMP', consents);
|
|
249
260
|
return this.setConsentsInternal(consents);
|
|
250
261
|
});
|
|
251
262
|
}
|
|
252
|
-
if ((0,
|
|
263
|
+
if ((0, utils_1.isPromise)(config?.consents)) {
|
|
253
264
|
includeAdvertising = (0, consents_1.applyAdvertisingConsent)(config?.consents, config?.requireAdvertisingOptIn);
|
|
254
265
|
}
|
|
255
266
|
else {
|
|
@@ -265,7 +276,7 @@ class Tracker {
|
|
|
265
276
|
identity.clearCookieJweIfStale(config?.nativeJwe);
|
|
266
277
|
const deployStage = config?.deployStage || 'pro';
|
|
267
278
|
const deployStageTpaas = config?.deployStageTpaas || 'pre';
|
|
268
|
-
this.state = (0,
|
|
279
|
+
this.state = (0, utils_1.pulseMerge)({}, config_1.baseConfig, {
|
|
269
280
|
collectorBaseUrl: config_browser_1.collectorEndpoints[deployStage],
|
|
270
281
|
deployStage,
|
|
271
282
|
deployStageTpaas,
|
|
@@ -282,7 +293,7 @@ class Tracker {
|
|
|
282
293
|
vendors: config?.vendors?.length ? [] : ['xandr'],
|
|
283
294
|
}, config);
|
|
284
295
|
// Move to default config?
|
|
285
|
-
this.builders = (0,
|
|
296
|
+
this.builders = (0, utils_1.pulseMerge)({}, builders, {
|
|
286
297
|
provider: {
|
|
287
298
|
id: providerId,
|
|
288
299
|
...(config?.component !== undefined && { component: config.component }),
|
|
@@ -302,7 +313,7 @@ class Tracker {
|
|
|
302
313
|
this.retryTpaasEventQueue = [];
|
|
303
314
|
if (this.state.environment === 'browser') {
|
|
304
315
|
// @ts-expect-error
|
|
305
|
-
if (
|
|
316
|
+
if (utils_1.isBrowser && window.navigator?.sendBeacon) {
|
|
306
317
|
const originalUseBeacon = this.state.useBeacon;
|
|
307
318
|
window.addEventListener('pagehide', () => {
|
|
308
319
|
this.state.useBeacon = true;
|
|
@@ -316,7 +327,7 @@ class Tracker {
|
|
|
316
327
|
}
|
|
317
328
|
}
|
|
318
329
|
// @ts-expect-error
|
|
319
|
-
this.debouncedSend = (0,
|
|
330
|
+
this.debouncedSend = (0, utils_1.throttle)(async () => {
|
|
320
331
|
try {
|
|
321
332
|
return await this._sendImmediately();
|
|
322
333
|
}
|
|
@@ -325,7 +336,7 @@ class Tracker {
|
|
|
325
336
|
}
|
|
326
337
|
}, this.state.eventDebounce);
|
|
327
338
|
// @ts-expect-error
|
|
328
|
-
this.debouncedSendAnonymous = (0,
|
|
339
|
+
this.debouncedSendAnonymous = (0, utils_1.throttle)(async () => {
|
|
329
340
|
try {
|
|
330
341
|
return await this._sendImmediatelyAnonymous();
|
|
331
342
|
}
|
|
@@ -334,7 +345,7 @@ class Tracker {
|
|
|
334
345
|
}
|
|
335
346
|
}, this.state.eventDebounce);
|
|
336
347
|
// @ts-expect-error
|
|
337
|
-
this.debouncedSendTpaas = (0,
|
|
348
|
+
this.debouncedSendTpaas = (0, utils_1.throttle)(async () => {
|
|
338
349
|
try {
|
|
339
350
|
return await this._sendImmediatelyTpaas();
|
|
340
351
|
}
|
|
@@ -445,7 +456,7 @@ class Tracker {
|
|
|
445
456
|
await this._applyRemoteConfigEndpoints();
|
|
446
457
|
// Resolve all available properties ----------------
|
|
447
458
|
const resolvedOutput = await Promise.all([this.resolveTrackInput(newEvent), this.resolveTrackGlobals()]);
|
|
448
|
-
let eventOutput = resolvedOutput.reduce((acc, p) => (0,
|
|
459
|
+
let eventOutput = resolvedOutput.reduce((acc, p) => (0, utils_1.pulseMerge)(acc, p), {});
|
|
449
460
|
eventOutput = this.applyAnonymousEventTypeDefaults(eventOutput, eventType);
|
|
450
461
|
// Leave Events ----------------
|
|
451
462
|
// they require (most) properties of the previous PageView event, which was saved under a bookmark key when tracked
|
|
@@ -497,15 +508,22 @@ class Tracker {
|
|
|
497
508
|
catch (ex) {
|
|
498
509
|
loglevel_1.default.trace('Failed to sync remote config', ex);
|
|
499
510
|
}
|
|
511
|
+
const [experiments, currentPageReferrer] = await Promise.all([
|
|
512
|
+
this.adaptExperiments(this.builders.experiments),
|
|
513
|
+
this.currentPageReferrer,
|
|
514
|
+
]);
|
|
500
515
|
return {
|
|
501
516
|
autoTrackerVersion: this.builders.tracker?.autoTrackerVersion,
|
|
502
517
|
version: version_1.SDK_VERSION,
|
|
503
518
|
isHybrid: !!this.state.isHybrid,
|
|
504
519
|
pageviewId: this.state.pageViewId,
|
|
505
520
|
providerId: this.state.providerId,
|
|
521
|
+
providerName: this.state.provider?.name,
|
|
522
|
+
providerGroup: this.state.provider?.group,
|
|
506
523
|
component: this.state.component,
|
|
507
524
|
componentVersion: this.state.componentVersion,
|
|
508
|
-
experiments
|
|
525
|
+
experiments,
|
|
526
|
+
currentPageReferrer,
|
|
509
527
|
};
|
|
510
528
|
}
|
|
511
529
|
/**
|
|
@@ -530,7 +548,7 @@ class Tracker {
|
|
|
530
548
|
id: actor.id?.toString() || '',
|
|
531
549
|
realm: actor.realm || '',
|
|
532
550
|
hasAnySubscription: !!actor.hasAnySubscription,
|
|
533
|
-
region: (0,
|
|
551
|
+
region: (0, utils_1.isString)(actor.region) ? actor.region : undefined,
|
|
534
552
|
};
|
|
535
553
|
}
|
|
536
554
|
function adaptConsentsToNewFormat(consents) {
|
|
@@ -568,13 +586,14 @@ class Tracker {
|
|
|
568
586
|
source: source || 'unknown',
|
|
569
587
|
};
|
|
570
588
|
}
|
|
571
|
-
const [actor, consents, experiments, currentPage] = await Promise.all([
|
|
589
|
+
const [actor, consents, experiments, currentPage, currentPageReferrer] = await Promise.all([
|
|
572
590
|
this.getActor(),
|
|
573
591
|
this.getConsents(),
|
|
574
592
|
this.adaptExperiments(this.builders.experiments),
|
|
575
593
|
this.getCurrentTpaasPage(),
|
|
594
|
+
this.currentPageReferrer,
|
|
576
595
|
]);
|
|
577
|
-
const { environmentId, jwe } = (0,
|
|
596
|
+
const { environmentId, jwe } = (0, cis_sync_1.parsePulseCookies)();
|
|
578
597
|
return {
|
|
579
598
|
autoTrackerVersion: this.builders.tracker?.autoTrackerVersion,
|
|
580
599
|
version: version_1.SDK_VERSION,
|
|
@@ -582,10 +601,13 @@ class Tracker {
|
|
|
582
601
|
user: adaptActorToNewFormat(actor),
|
|
583
602
|
consents: adaptConsentsToNewFormat(consents),
|
|
584
603
|
providerId: this.state.providerId,
|
|
604
|
+
providerName: this.state.provider?.name,
|
|
605
|
+
providerGroup: this.state.provider?.group,
|
|
585
606
|
component: this.state.component,
|
|
586
607
|
componentVersion: this.state.componentVersion,
|
|
587
608
|
pageviewId: this.state.pageViewId,
|
|
588
609
|
currentPage,
|
|
610
|
+
currentPageReferrer,
|
|
589
611
|
experiments,
|
|
590
612
|
environmentId,
|
|
591
613
|
jwe,
|
|
@@ -829,32 +851,32 @@ class Tracker {
|
|
|
829
851
|
*/
|
|
830
852
|
async trackAnonymousViewUIElement(input) {
|
|
831
853
|
const dependencies = await this.prepareAnonymousTpaasEvent();
|
|
832
|
-
const event = (0,
|
|
854
|
+
const event = (0, tpaas_builders_1.buildAnonymousViewUIElementEvent)(input, dependencies);
|
|
833
855
|
return this.sendTpaasEvent(event);
|
|
834
856
|
}
|
|
835
857
|
async trackCompletedHealthAction(input) {
|
|
836
858
|
const dependencies = await this.prepareTpaasEvent();
|
|
837
|
-
const event = (0,
|
|
859
|
+
const event = (0, tpaas_builders_1.buildCompletedHealthActionEvent)(input, dependencies);
|
|
838
860
|
return this.sendTpaasEvent(event);
|
|
839
861
|
}
|
|
840
862
|
async trackEngagementHealthUIElement(input) {
|
|
841
863
|
const dependencies = await this.prepareTpaasEvent();
|
|
842
|
-
const event = (0,
|
|
864
|
+
const event = (0, tpaas_builders_1.buildEngagementHealthUIElementEvent)(input, dependencies);
|
|
843
865
|
return this.sendTpaasEvent(event);
|
|
844
866
|
}
|
|
845
867
|
async trackViewHealthPage(input, options) {
|
|
846
868
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
847
|
-
this.
|
|
869
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewHealthPage.object.objectType, input.page?.referrer);
|
|
848
870
|
const dependencies = await this.prepareTpaasEvent();
|
|
849
|
-
const event = (0,
|
|
871
|
+
const event = (0, tpaas_builders_1.buildViewHealthPageEvent)(input, dependencies);
|
|
850
872
|
const result = this.sendTpaasEvent(event);
|
|
851
873
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
852
874
|
const leavePageCallback = async (leave) => {
|
|
853
875
|
// HealthView Page is a bit special, in the sense that in doesn't have a dedicated Leave event.
|
|
854
876
|
// Instead, we need to reuse the generic Leave Page event, but adapt the input accordingly.
|
|
855
877
|
// This means omitting some fields from HealthView Page that are not part of Leave Page schema.
|
|
856
|
-
const { experiments, metrics, object, origin, ...restInput } = input;
|
|
857
|
-
const { category, custom, intent, name, tags, ...restObject } = input.object;
|
|
878
|
+
const { experiments, metrics, object, origin, userHealthData, ...restInput } = input;
|
|
879
|
+
const { category, custom, intent, name, tags, food, physicalActivity, training, ...restObject } = input.object;
|
|
858
880
|
await this.trackLeavePage({
|
|
859
881
|
leave,
|
|
860
882
|
...restInput,
|
|
@@ -874,7 +896,7 @@ class Tracker {
|
|
|
874
896
|
}
|
|
875
897
|
async trackImpressionHealthUIElement(input) {
|
|
876
898
|
const dependencies = await this.prepareTpaasEvent();
|
|
877
|
-
const event = (0,
|
|
899
|
+
const event = (0, tpaas_builders_1.buildImpressionHealthUIElementEvent)(input, dependencies);
|
|
878
900
|
return this.sendTpaasEvent(event);
|
|
879
901
|
}
|
|
880
902
|
/**
|
|
@@ -884,9 +906,9 @@ class Tracker {
|
|
|
884
906
|
*/
|
|
885
907
|
async trackViewPage(input, options) {
|
|
886
908
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
887
|
-
this.
|
|
909
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewPage.object.objectType, input.page?.referrer);
|
|
888
910
|
const dependencies = await this.prepareTpaasEvent();
|
|
889
|
-
const event = (0,
|
|
911
|
+
const event = (0, tpaas_builders_1.buildViewPageEvent)(input, dependencies);
|
|
890
912
|
const result = this.sendTpaasEvent(event);
|
|
891
913
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
892
914
|
const leavePageCallback = async (leave) => {
|
|
@@ -910,9 +932,9 @@ class Tracker {
|
|
|
910
932
|
*/
|
|
911
933
|
async trackViewSportsPage(input, options) {
|
|
912
934
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
913
|
-
this.
|
|
935
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewSportsPage.object.objectType, input.page?.referrer);
|
|
914
936
|
const dependencies = await this.prepareTpaasEvent();
|
|
915
|
-
const event = (0,
|
|
937
|
+
const event = (0, tpaas_builders_1.buildViewSportsPageEvent)(input, dependencies);
|
|
916
938
|
const result = this.sendTpaasEvent(event);
|
|
917
939
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
918
940
|
const leaveSportsPageCallback = async (leave) => {
|
|
@@ -935,9 +957,9 @@ class Tracker {
|
|
|
935
957
|
*/
|
|
936
958
|
async trackViewTitle(input) {
|
|
937
959
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
938
|
-
this.
|
|
960
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewTitle.object.objectType, input.page?.referrer);
|
|
939
961
|
const dependencies = await this.prepareTpaasEvent();
|
|
940
|
-
const event = (0,
|
|
962
|
+
const event = (0, tpaas_builders_1.buildViewTitleEvent)(input, dependencies);
|
|
941
963
|
return this.sendTpaasEvent(event);
|
|
942
964
|
// there's no Leave Title event
|
|
943
965
|
}
|
|
@@ -947,7 +969,7 @@ class Tracker {
|
|
|
947
969
|
*/
|
|
948
970
|
async trackImpressionWidget(input) {
|
|
949
971
|
const dependencies = await this.prepareTpaasEvent();
|
|
950
|
-
const event = (0,
|
|
972
|
+
const event = (0, tpaas_builders_1.buildImpressionWidgetEvent)(input, dependencies);
|
|
951
973
|
return this.sendTpaasEvent(event);
|
|
952
974
|
}
|
|
953
975
|
/**
|
|
@@ -957,9 +979,9 @@ class Tracker {
|
|
|
957
979
|
*/
|
|
958
980
|
async trackViewArticle(input, options) {
|
|
959
981
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
960
|
-
this.
|
|
982
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewArticle.object.objectType, input.page?.referrer);
|
|
961
983
|
const dependencies = await this.prepareTpaasEvent();
|
|
962
|
-
const event = (0,
|
|
984
|
+
const event = (0, tpaas_builders_1.buildViewArticleEvent)(input, dependencies);
|
|
963
985
|
const result = this.sendTpaasEvent(event);
|
|
964
986
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
965
987
|
const leaveArticleCallback = async (leave) => {
|
|
@@ -1018,9 +1040,9 @@ class Tracker {
|
|
|
1018
1040
|
*/
|
|
1019
1041
|
async trackViewAudioPage(input, options) {
|
|
1020
1042
|
this.newPageView();
|
|
1021
|
-
this.
|
|
1043
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewAudioPage.object.objectType, input.page?.referrer);
|
|
1022
1044
|
const dependencies = await this.prepareTpaasEvent();
|
|
1023
|
-
const event = (0,
|
|
1045
|
+
const event = (0, tpaas_builders_1.buildViewAudioPageEvent)(input, dependencies);
|
|
1024
1046
|
const result = this.sendTpaasEvent(event);
|
|
1025
1047
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1026
1048
|
const { leaveAudioBuilder, ...restLeaveTrackingOptions } = options.leaveTracking;
|
|
@@ -1056,9 +1078,9 @@ class Tracker {
|
|
|
1056
1078
|
*/
|
|
1057
1079
|
async trackViewError(input, options) {
|
|
1058
1080
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1059
|
-
this.
|
|
1081
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewError.object.objectType, input.page?.referrer);
|
|
1060
1082
|
const dependencies = await this.prepareTpaasEvent();
|
|
1061
|
-
const event = (0,
|
|
1083
|
+
const event = (0, tpaas_builders_1.buildViewErrorEvent)(input, dependencies);
|
|
1062
1084
|
const result = this.sendTpaasEvent(event);
|
|
1063
1085
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1064
1086
|
const leaveErrorCallback = async (leave) => {
|
|
@@ -1081,7 +1103,7 @@ class Tracker {
|
|
|
1081
1103
|
*/
|
|
1082
1104
|
async trackImpressionAdSlot(input) {
|
|
1083
1105
|
const dependencies = await this.prepareTpaasEvent();
|
|
1084
|
-
const event = (0,
|
|
1106
|
+
const event = (0, tpaas_builders_1.buildImpressionAdSlotEvent)(input, dependencies);
|
|
1085
1107
|
return this.sendTpaasEvent(event);
|
|
1086
1108
|
}
|
|
1087
1109
|
/**
|
|
@@ -1090,7 +1112,7 @@ class Tracker {
|
|
|
1090
1112
|
*/
|
|
1091
1113
|
async trackImpressionForm(input) {
|
|
1092
1114
|
const dependencies = await this.prepareTpaasEvent();
|
|
1093
|
-
const event = (0,
|
|
1115
|
+
const event = (0, tpaas_builders_1.buildImpressionFormEvent)(input, dependencies);
|
|
1094
1116
|
return this.sendTpaasEvent(event);
|
|
1095
1117
|
}
|
|
1096
1118
|
/**
|
|
@@ -1099,7 +1121,7 @@ class Tracker {
|
|
|
1099
1121
|
*/
|
|
1100
1122
|
async trackImpressionOffer(input) {
|
|
1101
1123
|
const dependencies = await this.prepareTpaasEvent();
|
|
1102
|
-
const event = (0,
|
|
1124
|
+
const event = (0, tpaas_builders_1.buildImpressionOfferEvent)(input, dependencies);
|
|
1103
1125
|
return this.sendTpaasEvent(event);
|
|
1104
1126
|
}
|
|
1105
1127
|
/**
|
|
@@ -1108,7 +1130,7 @@ class Tracker {
|
|
|
1108
1130
|
*/
|
|
1109
1131
|
async trackImpressionPlayer(input) {
|
|
1110
1132
|
const dependencies = await this.prepareTpaasEvent();
|
|
1111
|
-
const event = (0,
|
|
1133
|
+
const event = (0, tpaas_builders_1.buildImpressionPlayerEvent)(input, dependencies);
|
|
1112
1134
|
return this.sendTpaasEvent(event);
|
|
1113
1135
|
}
|
|
1114
1136
|
/**
|
|
@@ -1117,7 +1139,7 @@ class Tracker {
|
|
|
1117
1139
|
*/
|
|
1118
1140
|
async trackImpressionTeaser(input) {
|
|
1119
1141
|
const dependencies = await this.prepareTpaasEvent();
|
|
1120
|
-
const event = (0,
|
|
1142
|
+
const event = (0, tpaas_builders_1.buildImpressionTeaserEvent)(input, dependencies);
|
|
1121
1143
|
return this.sendTpaasEvent(event);
|
|
1122
1144
|
}
|
|
1123
1145
|
/**
|
|
@@ -1126,7 +1148,7 @@ class Tracker {
|
|
|
1126
1148
|
*/
|
|
1127
1149
|
async trackImpressionUIElement(input) {
|
|
1128
1150
|
const dependencies = await this.prepareTpaasEvent();
|
|
1129
|
-
const event = (0,
|
|
1151
|
+
const event = (0, tpaas_builders_1.buildImpressionUIElementEvent)(input, dependencies);
|
|
1130
1152
|
return this.sendTpaasEvent(event);
|
|
1131
1153
|
}
|
|
1132
1154
|
/**
|
|
@@ -1136,9 +1158,9 @@ class Tracker {
|
|
|
1136
1158
|
*/
|
|
1137
1159
|
async trackViewFrontpage(input, options) {
|
|
1138
1160
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1139
|
-
this.
|
|
1161
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewFrontpage.object.objectType, input.page?.referrer);
|
|
1140
1162
|
const dependencies = await this.prepareTpaasEvent();
|
|
1141
|
-
const event = (0,
|
|
1163
|
+
const event = (0, tpaas_builders_1.buildViewFrontpageEvent)(input, dependencies);
|
|
1142
1164
|
const result = this.sendTpaasEvent(event);
|
|
1143
1165
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1144
1166
|
const leaveFrontpageCallback = async (leave) => {
|
|
@@ -1162,9 +1184,9 @@ class Tracker {
|
|
|
1162
1184
|
*/
|
|
1163
1185
|
async trackViewLandingpage(input, options) {
|
|
1164
1186
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1165
|
-
this.
|
|
1187
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewLandingpage.object.objectType, input.page?.referrer);
|
|
1166
1188
|
const dependencies = await this.prepareTpaasEvent();
|
|
1167
|
-
const event = (0,
|
|
1189
|
+
const event = (0, tpaas_builders_1.buildViewLandingpageEvent)(input, dependencies);
|
|
1168
1190
|
const result = this.sendTpaasEvent(event);
|
|
1169
1191
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1170
1192
|
const leaveLandingpageCallback = async (leave) => {
|
|
@@ -1188,9 +1210,9 @@ class Tracker {
|
|
|
1188
1210
|
*/
|
|
1189
1211
|
async trackViewListing(input, options) {
|
|
1190
1212
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1191
|
-
this.
|
|
1213
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewListing.object.objectType, input.page?.referrer);
|
|
1192
1214
|
const dependencies = await this.prepareTpaasEvent();
|
|
1193
|
-
const event = (0,
|
|
1215
|
+
const event = (0, tpaas_builders_1.buildViewListingEvent)(input, dependencies);
|
|
1194
1216
|
const result = this.sendTpaasEvent(event);
|
|
1195
1217
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1196
1218
|
const leaveListingCallback = async (leave) => {
|
|
@@ -1214,9 +1236,9 @@ class Tracker {
|
|
|
1214
1236
|
*/
|
|
1215
1237
|
async trackViewLockedArticle(input, options) {
|
|
1216
1238
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1217
|
-
this.
|
|
1239
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewLockedArticle.object.objectType, input.page?.referrer);
|
|
1218
1240
|
const dependencies = await this.prepareTpaasEvent();
|
|
1219
|
-
const event = (0,
|
|
1241
|
+
const event = (0, tpaas_builders_1.buildViewLockedArticleEvent)(input, dependencies);
|
|
1220
1242
|
const result = this.sendTpaasEvent(event);
|
|
1221
1243
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1222
1244
|
const leaveLockedArticleCallback = async (leave) => {
|
|
@@ -1240,9 +1262,9 @@ class Tracker {
|
|
|
1240
1262
|
*/
|
|
1241
1263
|
async trackViewLockedAudioPage(input, options) {
|
|
1242
1264
|
this.newPageView();
|
|
1243
|
-
this.
|
|
1265
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewLockedAudioPage.object.objectType, input.page?.referrer);
|
|
1244
1266
|
const dependencies = await this.prepareTpaasEvent();
|
|
1245
|
-
const event = (0,
|
|
1267
|
+
const event = (0, tpaas_builders_1.buildViewLockedAudioPageEvent)(input, dependencies);
|
|
1246
1268
|
const result = this.sendTpaasEvent(event);
|
|
1247
1269
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1248
1270
|
const leaveLockedAudioPageCallback = async (leave) => {
|
|
@@ -1266,9 +1288,9 @@ class Tracker {
|
|
|
1266
1288
|
*/
|
|
1267
1289
|
async trackViewLockedVideoPage(input, options) {
|
|
1268
1290
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1269
|
-
this.
|
|
1291
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewLockedVideoPage.object.objectType, input.page?.referrer);
|
|
1270
1292
|
const dependencies = await this.prepareTpaasEvent();
|
|
1271
|
-
const event = (0,
|
|
1293
|
+
const event = (0, tpaas_builders_1.buildViewLockedVideoPageEvent)(input, dependencies);
|
|
1272
1294
|
const result = this.sendTpaasEvent(event);
|
|
1273
1295
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1274
1296
|
const leaveLockedVideoPageCallback = async (leave) => {
|
|
@@ -1329,9 +1351,9 @@ class Tracker {
|
|
|
1329
1351
|
*/
|
|
1330
1352
|
async trackViewVideoPage(input, options) {
|
|
1331
1353
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1332
|
-
this.
|
|
1354
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewVideoPage.object.objectType, input.page?.referrer);
|
|
1333
1355
|
const dependencies = await this.prepareTpaasEvent();
|
|
1334
|
-
const event = (0,
|
|
1356
|
+
const event = (0, tpaas_builders_1.buildViewVideoPageEvent)(input, dependencies);
|
|
1335
1357
|
const result = this.sendTpaasEvent(event);
|
|
1336
1358
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1337
1359
|
const { leaveStoriesBuilder, ...restLeaveTrackingOptions } = options.leaveTracking;
|
|
@@ -1362,9 +1384,9 @@ class Tracker {
|
|
|
1362
1384
|
*/
|
|
1363
1385
|
async trackViewWeather(input, options) {
|
|
1364
1386
|
this.newPageView(); // Reset the page view ID if it is not set, to ensure a new page view is tracked
|
|
1365
|
-
this.
|
|
1387
|
+
this.setCurrentTpaasPageData(input.object.objectId, tpaas_schemas_1.ViewWeather.object.objectType, input.page?.referrer);
|
|
1366
1388
|
const dependencies = await this.prepareTpaasEvent();
|
|
1367
|
-
const event = (0,
|
|
1389
|
+
const event = (0, tpaas_builders_1.buildViewWeatherEvent)(input, dependencies);
|
|
1368
1390
|
const result = this.sendTpaasEvent(event);
|
|
1369
1391
|
if ((0, leaveTrackingTpaas_1.shouldEnableLeaveTracking)(options.leaveTracking)) {
|
|
1370
1392
|
const leaveWeatherCallback = async (leave) => {
|
|
@@ -1387,7 +1409,7 @@ class Tracker {
|
|
|
1387
1409
|
*/
|
|
1388
1410
|
async trackLeaveArticle(input) {
|
|
1389
1411
|
const dependencies = await this.prepareTpaasEvent();
|
|
1390
|
-
const event = (0,
|
|
1412
|
+
const event = (0, tpaas_builders_1.buildLeaveArticleEvent)(input, dependencies);
|
|
1391
1413
|
return this.sendTpaasEvent(event);
|
|
1392
1414
|
}
|
|
1393
1415
|
/**
|
|
@@ -1396,7 +1418,7 @@ class Tracker {
|
|
|
1396
1418
|
*/
|
|
1397
1419
|
async trackLeaveAudioPage(input) {
|
|
1398
1420
|
const dependencies = await this.prepareTpaasEvent();
|
|
1399
|
-
const event = (0,
|
|
1421
|
+
const event = (0, tpaas_builders_1.buildLeaveAudioPageEvent)(input, dependencies);
|
|
1400
1422
|
return this.sendTpaasEvent(event);
|
|
1401
1423
|
}
|
|
1402
1424
|
/**
|
|
@@ -1405,7 +1427,7 @@ class Tracker {
|
|
|
1405
1427
|
*/
|
|
1406
1428
|
async trackLeaveError(input) {
|
|
1407
1429
|
const dependencies = await this.prepareTpaasEvent();
|
|
1408
|
-
const event = (0,
|
|
1430
|
+
const event = (0, tpaas_builders_1.buildLeaveErrorEvent)(input, dependencies);
|
|
1409
1431
|
return this.sendTpaasEvent(event);
|
|
1410
1432
|
}
|
|
1411
1433
|
/**
|
|
@@ -1414,7 +1436,7 @@ class Tracker {
|
|
|
1414
1436
|
*/
|
|
1415
1437
|
async trackLeaveFrontpage(input) {
|
|
1416
1438
|
const dependencies = await this.prepareTpaasEvent();
|
|
1417
|
-
const event = (0,
|
|
1439
|
+
const event = (0, tpaas_builders_1.buildLeaveFrontpageEvent)(input, dependencies);
|
|
1418
1440
|
return this.sendTpaasEvent(event);
|
|
1419
1441
|
}
|
|
1420
1442
|
/**
|
|
@@ -1423,7 +1445,7 @@ class Tracker {
|
|
|
1423
1445
|
*/
|
|
1424
1446
|
async trackLeaveLandingpage(input) {
|
|
1425
1447
|
const dependencies = await this.prepareTpaasEvent();
|
|
1426
|
-
const event = (0,
|
|
1448
|
+
const event = (0, tpaas_builders_1.buildLeaveLandingpageEvent)(input, dependencies);
|
|
1427
1449
|
return this.sendTpaasEvent(event);
|
|
1428
1450
|
}
|
|
1429
1451
|
/**
|
|
@@ -1432,7 +1454,7 @@ class Tracker {
|
|
|
1432
1454
|
*/
|
|
1433
1455
|
async trackLeaveListing(input) {
|
|
1434
1456
|
const dependencies = await this.prepareTpaasEvent();
|
|
1435
|
-
const event = (0,
|
|
1457
|
+
const event = (0, tpaas_builders_1.buildLeaveListingEvent)(input, dependencies);
|
|
1436
1458
|
return this.sendTpaasEvent(event);
|
|
1437
1459
|
}
|
|
1438
1460
|
/**
|
|
@@ -1441,7 +1463,7 @@ class Tracker {
|
|
|
1441
1463
|
*/
|
|
1442
1464
|
async trackLeaveLockedArticle(input) {
|
|
1443
1465
|
const dependencies = await this.prepareTpaasEvent();
|
|
1444
|
-
const event = (0,
|
|
1466
|
+
const event = (0, tpaas_builders_1.buildLeaveLockedArticleEvent)(input, dependencies);
|
|
1445
1467
|
return this.sendTpaasEvent(event);
|
|
1446
1468
|
}
|
|
1447
1469
|
/**
|
|
@@ -1450,7 +1472,7 @@ class Tracker {
|
|
|
1450
1472
|
*/
|
|
1451
1473
|
async trackLeaveLockedAudioPage(input) {
|
|
1452
1474
|
const dependencies = await this.prepareTpaasEvent();
|
|
1453
|
-
const event = (0,
|
|
1475
|
+
const event = (0, tpaas_builders_1.buildLeaveLockedAudioPageEvent)(input, dependencies);
|
|
1454
1476
|
return this.sendTpaasEvent(event);
|
|
1455
1477
|
}
|
|
1456
1478
|
/**
|
|
@@ -1459,7 +1481,7 @@ class Tracker {
|
|
|
1459
1481
|
*/
|
|
1460
1482
|
async trackLeaveLockedVideoPage(input) {
|
|
1461
1483
|
const dependencies = await this.prepareTpaasEvent();
|
|
1462
|
-
const event = (0,
|
|
1484
|
+
const event = (0, tpaas_builders_1.buildLeaveLockedVideoPageEvent)(input, dependencies);
|
|
1463
1485
|
return this.sendTpaasEvent(event);
|
|
1464
1486
|
}
|
|
1465
1487
|
/**
|
|
@@ -1468,7 +1490,7 @@ class Tracker {
|
|
|
1468
1490
|
*/
|
|
1469
1491
|
async trackLeavePage(input) {
|
|
1470
1492
|
const dependencies = await this.prepareTpaasEvent();
|
|
1471
|
-
const event = (0,
|
|
1493
|
+
const event = (0, tpaas_builders_1.buildLeavePageEvent)(input, dependencies);
|
|
1472
1494
|
return this.sendTpaasEvent(event);
|
|
1473
1495
|
}
|
|
1474
1496
|
/**
|
|
@@ -1477,7 +1499,7 @@ class Tracker {
|
|
|
1477
1499
|
*/
|
|
1478
1500
|
async trackLeaveSportsPage(input) {
|
|
1479
1501
|
const dependencies = await this.prepareTpaasEvent();
|
|
1480
|
-
const event = (0,
|
|
1502
|
+
const event = (0, tpaas_builders_1.buildLeaveSportsPageEvent)(input, dependencies);
|
|
1481
1503
|
return this.sendTpaasEvent(event);
|
|
1482
1504
|
}
|
|
1483
1505
|
/**
|
|
@@ -1486,7 +1508,7 @@ class Tracker {
|
|
|
1486
1508
|
*/
|
|
1487
1509
|
async trackLeaveVideoPage(input) {
|
|
1488
1510
|
const dependencies = await this.prepareTpaasEvent();
|
|
1489
|
-
const event = (0,
|
|
1511
|
+
const event = (0, tpaas_builders_1.buildLeaveVideoPageEvent)(input, dependencies);
|
|
1490
1512
|
return this.sendTpaasEvent(event);
|
|
1491
1513
|
}
|
|
1492
1514
|
/**
|
|
@@ -1495,7 +1517,7 @@ class Tracker {
|
|
|
1495
1517
|
*/
|
|
1496
1518
|
async trackLeaveWeather(input) {
|
|
1497
1519
|
const dependencies = await this.prepareTpaasEvent();
|
|
1498
|
-
const event = (0,
|
|
1520
|
+
const event = (0, tpaas_builders_1.buildLeaveWeatherEvent)(input, dependencies);
|
|
1499
1521
|
return this.sendTpaasEvent(event);
|
|
1500
1522
|
}
|
|
1501
1523
|
/**
|
|
@@ -1504,7 +1526,7 @@ class Tracker {
|
|
|
1504
1526
|
*/
|
|
1505
1527
|
async trackEngagementAudio(input) {
|
|
1506
1528
|
const dependencies = await this.prepareTpaasEvent();
|
|
1507
|
-
const event = (0,
|
|
1529
|
+
const event = (0, tpaas_builders_1.buildEngagementAudioEvent)(input, dependencies);
|
|
1508
1530
|
return this.sendTpaasEvent(event);
|
|
1509
1531
|
}
|
|
1510
1532
|
/**
|
|
@@ -1513,7 +1535,7 @@ class Tracker {
|
|
|
1513
1535
|
*/
|
|
1514
1536
|
async trackEngagementForm(input) {
|
|
1515
1537
|
const dependencies = await this.prepareTpaasEvent();
|
|
1516
|
-
const event = (0,
|
|
1538
|
+
const event = (0, tpaas_builders_1.buildEngagementFormEvent)(input, dependencies);
|
|
1517
1539
|
return this.sendTpaasEvent(event);
|
|
1518
1540
|
}
|
|
1519
1541
|
/**
|
|
@@ -1522,7 +1544,7 @@ class Tracker {
|
|
|
1522
1544
|
*/
|
|
1523
1545
|
async trackEngagementOffer(input) {
|
|
1524
1546
|
const dependencies = await this.prepareTpaasEvent();
|
|
1525
|
-
const event = (0,
|
|
1547
|
+
const event = (0, tpaas_builders_1.buildEngagementOfferEvent)(input, dependencies);
|
|
1526
1548
|
return this.sendTpaasEvent(event);
|
|
1527
1549
|
}
|
|
1528
1550
|
/**
|
|
@@ -1531,7 +1553,7 @@ class Tracker {
|
|
|
1531
1553
|
*/
|
|
1532
1554
|
async trackEngagementTeaser(input) {
|
|
1533
1555
|
const dependencies = await this.prepareTpaasEvent();
|
|
1534
|
-
const event = (0,
|
|
1556
|
+
const event = (0, tpaas_builders_1.buildEngagementTeaserEvent)(input, dependencies);
|
|
1535
1557
|
return this.sendTpaasEvent(event);
|
|
1536
1558
|
}
|
|
1537
1559
|
/**
|
|
@@ -1540,7 +1562,7 @@ class Tracker {
|
|
|
1540
1562
|
*/
|
|
1541
1563
|
async trackEngagementUIElement(input) {
|
|
1542
1564
|
const dependencies = await this.prepareTpaasEvent();
|
|
1543
|
-
const event = (0,
|
|
1565
|
+
const event = (0, tpaas_builders_1.buildEngagementUIElementEvent)(input, dependencies);
|
|
1544
1566
|
return this.sendTpaasEvent(event);
|
|
1545
1567
|
}
|
|
1546
1568
|
/**
|
|
@@ -1549,7 +1571,7 @@ class Tracker {
|
|
|
1549
1571
|
*/
|
|
1550
1572
|
async trackEngagementVideo(input) {
|
|
1551
1573
|
const dependencies = await this.prepareTpaasEvent();
|
|
1552
|
-
const event = (0,
|
|
1574
|
+
const event = (0, tpaas_builders_1.buildEngagementVideoEvent)(input, dependencies);
|
|
1553
1575
|
return this.sendTpaasEvent(event);
|
|
1554
1576
|
}
|
|
1555
1577
|
/**
|
|
@@ -1558,7 +1580,7 @@ class Tracker {
|
|
|
1558
1580
|
*/
|
|
1559
1581
|
async trackEngagementVideoAd(input) {
|
|
1560
1582
|
const dependencies = await this.prepareTpaasEvent();
|
|
1561
|
-
const event = (0,
|
|
1583
|
+
const event = (0, tpaas_builders_1.buildEngagementVideoAdEvent)(input, dependencies);
|
|
1562
1584
|
return this.sendTpaasEvent(event);
|
|
1563
1585
|
}
|
|
1564
1586
|
/**
|
|
@@ -1567,7 +1589,7 @@ class Tracker {
|
|
|
1567
1589
|
*/
|
|
1568
1590
|
async trackEngagementWidget(input) {
|
|
1569
1591
|
const dependencies = await this.prepareTpaasEvent();
|
|
1570
|
-
const event = (0,
|
|
1592
|
+
const event = (0, tpaas_builders_1.buildEngagementWidgetEvent)(input, dependencies);
|
|
1571
1593
|
return this.sendTpaasEvent(event);
|
|
1572
1594
|
}
|
|
1573
1595
|
/**
|
|
@@ -1581,7 +1603,7 @@ class Tracker {
|
|
|
1581
1603
|
this.resolveSessionIdPromise();
|
|
1582
1604
|
// The Hybrid use case implements a "bridged" event method, injected into the window scope,
|
|
1583
1605
|
// which is used to send events through the native app.
|
|
1584
|
-
if ((0,
|
|
1606
|
+
if ((0, utils_1.isFunction)(this.state.altEventHandler)) {
|
|
1585
1607
|
this.state.altEventHandler(JSON.stringify(event));
|
|
1586
1608
|
return event;
|
|
1587
1609
|
}
|
|
@@ -1664,7 +1686,7 @@ class Tracker {
|
|
|
1664
1686
|
eventInput: evaluatedInput,
|
|
1665
1687
|
sdkConfig: this.state,
|
|
1666
1688
|
});
|
|
1667
|
-
return (0,
|
|
1689
|
+
return (0, utils_1.evaluateAndFlatten)(data);
|
|
1668
1690
|
});
|
|
1669
1691
|
}
|
|
1670
1692
|
/**
|
|
@@ -1676,8 +1698,8 @@ class Tracker {
|
|
|
1676
1698
|
* @category Legacy Tracking
|
|
1677
1699
|
*/
|
|
1678
1700
|
async evaluateEventInputs(eventType, eventInput, builders = this.builders, options) {
|
|
1679
|
-
const buildersOutput = await Promise.all([(0,
|
|
1680
|
-
let eventOutput = buildersOutput.reduce((acc, p) => (0,
|
|
1701
|
+
const buildersOutput = await Promise.all([(0, utils_1.evaluateAndFlatten)(builders), (0, utils_1.evaluateAndFlatten)(eventInput)]);
|
|
1702
|
+
let eventOutput = buildersOutput.reduce((acc, p) => (0, utils_1.pulseMerge)(acc, p), {});
|
|
1681
1703
|
eventOutput = this.applyEventTypeDefaults(eventOutput, eventType);
|
|
1682
1704
|
eventOutput = this.applyBookmarkedEvent(eventOutput, options?.applyBookmarkKey);
|
|
1683
1705
|
eventOutput = await this.applyConsents(eventOutput);
|
|
@@ -1745,7 +1767,7 @@ class Tracker {
|
|
|
1745
1767
|
*/
|
|
1746
1768
|
update(builder, mergeBuilder = false) {
|
|
1747
1769
|
if (mergeBuilder) {
|
|
1748
|
-
this.builders = (0,
|
|
1770
|
+
this.builders = (0, utils_1.pulseMerge)({}, this.builders, builder);
|
|
1749
1771
|
}
|
|
1750
1772
|
else {
|
|
1751
1773
|
this.builders = Object.assign({}, this.builders, builder);
|
|
@@ -2238,13 +2260,13 @@ class Tracker {
|
|
|
2238
2260
|
* @private
|
|
2239
2261
|
*/
|
|
2240
2262
|
async resolveTrackInput(input) {
|
|
2241
|
-
return (0,
|
|
2263
|
+
return (0, utils_1.evaluateAndFlatten)(input);
|
|
2242
2264
|
}
|
|
2243
2265
|
/**
|
|
2244
2266
|
* @private
|
|
2245
2267
|
*/
|
|
2246
2268
|
async resolveTrackGlobals() {
|
|
2247
|
-
return (0,
|
|
2269
|
+
return (0, utils_1.evaluateAndFlatten)({ ...this.builders });
|
|
2248
2270
|
}
|
|
2249
2271
|
/**
|
|
2250
2272
|
* Send all anonymous events that are in the internal anonymous event queue.
|
|
@@ -2350,7 +2372,7 @@ class Tracker {
|
|
|
2350
2372
|
const session = (0, builders_1.session)({}, creationDate);
|
|
2351
2373
|
// Resolve any pending session ID promises
|
|
2352
2374
|
this.resolveSessionIdPromise();
|
|
2353
|
-
return (0,
|
|
2375
|
+
return (0, utils_1.pulseMerge)({}, eventInput, {
|
|
2354
2376
|
'@id': (0, uuid_1.v4)(),
|
|
2355
2377
|
creationDate: creationDate.toISOString(),
|
|
2356
2378
|
session,
|
|
@@ -2379,7 +2401,7 @@ class Tracker {
|
|
|
2379
2401
|
*/
|
|
2380
2402
|
createAnonymousEvent(eventInput) {
|
|
2381
2403
|
const creationDate = new Date();
|
|
2382
|
-
return (0,
|
|
2404
|
+
return (0, utils_1.pulseMerge)({}, eventInput, {
|
|
2383
2405
|
'@id': (0, uuid_1.v4)(),
|
|
2384
2406
|
creationDate: creationDate.toISOString(),
|
|
2385
2407
|
});
|
|
@@ -2392,7 +2414,7 @@ class Tracker {
|
|
|
2392
2414
|
*/
|
|
2393
2415
|
applyEventTypeDefaults(eventInput, eventType) {
|
|
2394
2416
|
const eventDefaults = getEventBuilder(eventType).defaults;
|
|
2395
|
-
return (0,
|
|
2417
|
+
return (0, utils_1.pulseMerge)({}, eventDefaults(), eventInput);
|
|
2396
2418
|
}
|
|
2397
2419
|
/**
|
|
2398
2420
|
* @param eventInput
|
|
@@ -2401,7 +2423,7 @@ class Tracker {
|
|
|
2401
2423
|
*/
|
|
2402
2424
|
applyAnonymousEventTypeDefaults(eventInput, eventType) {
|
|
2403
2425
|
const eventDefaults = getAnonymousEventBuilder(eventType).defaults;
|
|
2404
|
-
return (0,
|
|
2426
|
+
return (0, utils_1.pulseMerge)({}, eventDefaults(), eventInput);
|
|
2405
2427
|
}
|
|
2406
2428
|
/**
|
|
2407
2429
|
* applyBookmarkedEvent
|
|
@@ -2416,7 +2438,7 @@ class Tracker {
|
|
|
2416
2438
|
const eventOutput = Object.assign({}, eventInput);
|
|
2417
2439
|
const bookmarkedPageViewEvent = this.bookmark.get(bookmarkKey) ?? {};
|
|
2418
2440
|
const { '@id': _id, '@type': _type, creationDate: _creationDate, ...coreEvent } = bookmarkedPageViewEvent;
|
|
2419
|
-
return (0,
|
|
2441
|
+
return (0, utils_1.pulseMerge)({}, eventOutput, coreEvent);
|
|
2420
2442
|
}
|
|
2421
2443
|
/**
|
|
2422
2444
|
* applyConsents
|
|
@@ -2424,7 +2446,7 @@ class Tracker {
|
|
|
2424
2446
|
* @private
|
|
2425
2447
|
*/
|
|
2426
2448
|
async applyConsents(eventInput) {
|
|
2427
|
-
return (0,
|
|
2449
|
+
return (0, utils_1.pulseMerge)({}, eventInput, await this.evaluateConsents());
|
|
2428
2450
|
}
|
|
2429
2451
|
/**
|
|
2430
2452
|
* applyConsentsAnonymous
|
|
@@ -2432,7 +2454,7 @@ class Tracker {
|
|
|
2432
2454
|
* @private
|
|
2433
2455
|
*/
|
|
2434
2456
|
applyConsentsAnonymous(eventInput) {
|
|
2435
|
-
return (0,
|
|
2457
|
+
return (0, utils_1.pulseMerge)({}, eventInput, this.evaluateConsentsAnonymous());
|
|
2436
2458
|
}
|
|
2437
2459
|
/**
|
|
2438
2460
|
* Enriches the event with consent data saved in state.
|
|
@@ -2454,7 +2476,7 @@ class Tracker {
|
|
|
2454
2476
|
* @category Consents
|
|
2455
2477
|
*/
|
|
2456
2478
|
evaluateConsentsAnonymous() {
|
|
2457
|
-
const consents = (0,
|
|
2479
|
+
const consents = (0, utils_1.isPromise)(this.state.consents) ? (0, consent_manager_1.getFallbackConsents)() : this.state.consents;
|
|
2458
2480
|
return {
|
|
2459
2481
|
...(consents && { consents }),
|
|
2460
2482
|
};
|