A personal community project under @kyletaylored, MIT licensed.Not provided or supported by Datadog.
Getting started
Three steps: get RUM running, add a plugin to the init you already have, then confirm the events arrive. Budget an hour, most of which is waiting for a real order to come through.
Before installing anything, the sandbox runs these adapters against recorded platform payloads in your browser and shows every RUM call they make. It is the quickest way to see what a plugin will and will not send.
1. Add RUM
If RUM is already on the site, skip this. These plugins never call init themselves, so your application ID, sampling and privacy settings stay in charge. Follow Datadog's ownbrowser setup first and confirm sessions appear before adding a plugin.
2. Add a plugin
Put consent adapters first in plugins: [...]. A consent adapter setstrackingConsent = 'not-granted' before the SDK starts, so nothing is collected on a page where the banner has not been answered.
import { datadogRum } from '@datadog/browser-rum'
import { oneTrustPlugin } from '@kyletaylored/datadog-rum-plugin-onetrust'
import { wooCommercePlugin } from '@kyletaylored/datadog-rum-plugin-woocommerce'
datadogRum.init({
applicationId, clientToken, site, service, env, version,
plugins: [
oneTrustPlugin({ category: 'C0002' }), // holds RUM until analytics is accepted
wooCommercePlugin({ identifyUsers: true, includeItems: false }),
],
})On Shopify checkout the community adapter composes with the official one rather than replacing it. Both read the same sandbox analytics global, and they subscribe to different events, so there is no overlap.
// Settings > Customer events > custom pixel
DD_RUM.init({
/* ... */
plugins: [
DD_RUM.shopifyPlugin({ shopifyAnalytics: analytics }), // official: sandbox fixes, views, clicks, errors
DD_RUM_PLUGINS['shopify']({ analytics }), // community: checkout events, order value, setUser
],
})3. Check the events
- Turn on
debug: trueand reload. Every mapped event prints to the console with its attributes, along with the plugin's declared footprint. If nothing prints, the adapter is not seeing the platform's events — check that you are on the right page type. - Query the RUM Explorer. Start with the cheapest event to produce:
@type:action @action.name:commerce.add_to_cart - Place a test order and confirm one
commerce.purchase, withvalueas a number:
Reload the thank-you page. A second purchase must not appear; the core deduplicates on@type:action @action.name:commerce.purchasetransaction_idfor 24 hours. - Import the asset pack. The generated metrics need to exist before the dashboard shows anything.
Before you trust the numbers
Reconcile order count against the platform's admin report over a week. The accuracy bar is within 5%. Further out than that usually means one of three things:
- Consent coverage. Declined visitors send nothing at all, by design.
- The thank-you page is never reached. Some payment flows redirect elsewhere, or the shopper closes the tab.
- Sampling.
sessionSampleRatebelow 100 scales every count down with it.
These are browser-measured and directional by design. They exist to correlate business outcomes with performance, errors and replays — not to replace the platform's order reporting.
Common options
The same options work on every adapter, so one settings form covers all of them. See a plugin's page for its defaults.
| Option | Default | Use it when |
|---|---|---|
events | all | You only want part of the funnel |
identifyUsers | true | Turn off to send no user ID at all |
includeEmail / includeName | false | You have a lawful basis and want them on the session |
includeItems | false | You want line-item detail, at up to 20 entries per action |
actionPrefix | commerce. | The site already has its own naming convention. Only commerce is renamed; other families keep theirs |
consent | auto | ignore when the host page already owns trackingConsent, or pass a resolver |
beforeTrack | none | You need to edit or drop an event. It cannot reintroduce a blocked attribute |
debug | false | Working out why an event is not arriving |