@traveloka/core/tracking
This module pertains to how we collect tracking data.
Important files
-
Internal tracking
packages/core/tracking/useTracker.ts— For use in reactpackages/core/tracking/trackServerSide.ts— For use in server-side/middleware (as we need to pasreq)
-
Page view tracking
packages/core/tracking/PageViewTracker.ts— A component (included inwithTravelokaApp) that fires "page view" tracking using the hooks belowpackages/core/tracking/useTrackPageView.ts— The recommended hook to fire "page view"packages/core/tracking/usePageViewTracker.ts— Implementation detail to populate the data for "page view" tracking. Read the supplied documents for the semantic of the tracking behavior, e.g. how we handle incoming visit from Traveloka or externak site.
-
External tracking
packages/core/tracking/external/ExternalTrackingManager.tsx— Utility to utilize external-party tracking (this handles lazy-loading of the necessary scripts).