Skip to content
BonicBD
Documentation Tracking Setup

Send events through the data layer

The data layer is where event data is declared before any tag reads it. Keeping one event definition per business action, with stable names and stable parameter names, is what makes a server container maintainable.

Before you begin

  • A working BonicBD container with a verified tracking hostname.
  • A web container and a server container connected to that hostname.

1. The shape of an event

A data layer event is a name and an object of parameters. The name identifies the business action. The parameters carry the values a destination needs to match, attribute, or deduplicate the event.

The integrated tracker recognises a set of bbd-prefixed fields inside the data layer, including bbd_em, bbd_ph, bbd_fn, bbd_ln, bbd_ct, bbd_st, bbd_zp, bbd_country, and bbd_street. It also recognises a user_data object. Those are the fields the user data variables read.

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'purchase',
  value: 1250,
  currency: 'BDT',
  bbd_em: 'customer@example.com',
  bbd_ph: '+8801XXXXXXXXX',
  bbd_ct: 'Dhaka',
  bbd_country: 'BD',
});

2. Naming rules that keep tags working

Use the same event name in the web container and the server container. If the browser pushes purchase and the server container triggers on order_completed, the conversion never arrives at the destination.

Keep parameter names stable across events. A value that appears under total on one event and value on another forces every tag to check both, and a change to one of them silently breaks a tag that referenced the other.

  • One business action, one event name — no synonyms for the same action
  • Lowercase with underscores, matching the destination conventions you use
  • Currency as an ISO code on every event that carries a value

3. The Enricher and the bbd_ fields

The Enricher module writes enriched user data into the data layer so that downstream tags and the user data variables can read a single source. It looks at the BBD Context, data layer events, and cookies in that order for each field.

Because the Enricher writes into the data layer, a page push that happens after the Enricher runs will not see the enriched values. Push order matters when a page-level event depends on identity fields.

4. Deduplication

A browser-side tag and a server-side tag can both fire for the same action. The event identifier is what lets a destination recognise them as one event rather than two. Set a stable event identifier on every event that can be sent from both sides.

Without a shared identifier, a destination counts the same purchase twice, which shows up as an inflated conversion count rather than as an obvious error.

Note: If a purchase is counted twice, check the event identifier before checking anything else. That is the most common cause and the cheapest to verify.

Reviewed against the BonicBD documentation source on 2026-11-07. Dashboard labels can change; follow the current setup guide shown in your account.