Components and hooks
The latest package includes TrackKitSection, TrackKitLink, TrackKitButton, and useTrackKitCta so reusable components can inherit tracking context from parent sections.
Use this page with the Google Chrome extension DataLayer Checker to inspect React API, data-attribute, auto-discovery, manual helper, and custom event payloads as they are pushed to `window.dataLayer`.
The latest package includes TrackKitSection, TrackKitLink, TrackKitButton, and useTrackKitCta so reusable components can inherit tracking context from parent sections.
Existing data-track attributes still work for viewport, click, control, download, and inherited context examples.
Enable autoDiscovery in the provider to detect plain links and buttons automatically. Scroll to the auto-discovery section below.
Manual helpers cover video, progress, completion, custom parameters, and fully custom event names.
These controls are plain HTML. With autoDiscovery.enabled in the provider, TrackKit maps each element to content_cta_click or content_control_interaction.
a[href] navigation inside the app fires content_cta_click.
External destinations are inferred from the href.
View on GitHubDownload links set File media and Download target automatically.
Download checklistbutton[type="submit"] and submit inputs map to CTA clicks.
input[type="submit"] is detected the same way as a submit button.
button[type="button"] fires content_control_interaction.
input[type="button"] is treated as a control interaction.
Custom elements with button semantics are included in auto discovery.
role="tab" maps to control interactions for tabs and segmented UI.
Elements with aria-pressed are classified as controls.
aria-expanded helps classify expand/collapse controls.
This card fires automatically when it enters the viewport through data-track-view attributes and inherited section context.
Click this link to trigger a data-attribute CTA click event with visible link text and destination details.
Open data-attribute CTAIn production, the same CTA payload can come from TrackKitLink or useTrackKitCta when you prefer reusable React components over data attributes.
Fire a tab or control interaction with action text and input metadata.
Simulate a video play event with title, id, length, category, and page location.
Simulate a 50% video progress milestone for media analytics.
Simulate a successful form or workflow completion with response status and custom metadata.
Download CTAs force content media to File and target to Download so reporting can separate file downloads from normal navigation.
Download checklistSend a fully custom event name and arbitrary parameters for flows outside the predefined event schema.
Click any demo control, then refresh this log or inspect the same payloads in DataLayer Checker.
No events yet.