> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datalyr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Container vs Tracking-Only

> The Container is a built-in mode of dl.js, not a separate tag — when to let it manage your pixels vs hardcode them yourself

There is **one** DATALYR tag: `dl.js`. The "Container" is a **built-in mode** of that tag, not a separate script. So this isn't a choice between two tags — it's a choice of **mode**:

* **Container mode (default):** let `dl.js` load and manage your pixels/tags from the dashboard.
* **Tracking-only mode:** use `dl.js` for attribution + events, and hardcode your own ad pixels yourself (set `enableContainer: false`).

<Warning>
  There is no standalone `container.js` to install, and you should never load two DATALYR tags — `dl.js` already runs the Container. Loading a separate `container.js` alongside it double-fetches your config and double-fires your pixels.
</Warning>

## Quick comparison

|                          | Container mode (default)           | Tracking-only mode                        |
| ------------------------ | ---------------------------------- | ----------------------------------------- |
| **Tag**                  | `dl.js`                            | `dl.js` (same tag)                        |
| **How**                  | configure pixels in the dashboard  | `enableContainer: false`, hardcode pixels |
| **Pixel changes**        | instant, from the dashboard        | code change + deploy                      |
| **Conditional loading**  | built-in (URL / referrer / device) | you code it                               |
| **Managed by**           | marketers, no code                 | developers                                |
| **Best for**             | most sites, multiple ad platforms  | full manual control / specific setups     |
| **Attribution + events** | ✅                                  | ✅ (identical — same tag)                  |

Attribution, UTM/click-ID capture, session tracking, and the Identity Bridge work **the same in both modes** — they're part of `dl.js`. The only difference is whether `dl.js` also loads your *dashboard-configured* pixels.

## Container mode (default — recommended)

`dl.js` fetches `/container-scripts` on load and fires the Meta/Google/TikTok pixels and custom scripts you've configured, with their triggers and conditions. Use it when you want to:

* Manage multiple ad pixels without editing code
* Update pixel IDs / events instantly from the dashboard
* Let marketers add tags without a developer
* Conditionally load scripts by URL, referrer, or device
* Disable a tag instantly if something breaks

```html theme={null}
<head>
  <script
    defer
    src="https://track.datalyr.com/dl.js"
    data-workspace-id="YOUR_WORKSPACE_ID">
  </script>
</head>
```

Then add tags in **Settings → Pixels & scripts**. No further code changes.

## Tracking-only mode

If you'd rather hardcode your own ad pixels (e.g. you want them server-rendered, or you manage them in your own code), disable the Container so `dl.js` doesn't also load dashboard tags — you still get full attribution + event tracking:

```js theme={null}
// npm SDK
datalyr.init({ workspaceId: 'YOUR_WORKSPACE_ID', enableContainer: false });
```

```html theme={null}
<!-- ...then add your own pixels by hand, e.g. Meta -->
<script>
  !function(f,b,e,v,n,t,s){/* fbevents */}(window,document,'script',
  'https://connect.facebook.net/en_US/fbevents.js');
  fbq('init', 'YOUR_PIXEL_ID');
  fbq('track', 'PageView');
</script>
```

<Note>
  If you're firing your own Meta Pixel **and** sending server-side CAPI, pass a shared `eventID` to `fbq('track', …, { eventID })` that matches the server event's `event_id` so Meta dedupes them. (Container mode does this for you.)
</Note>

## Switching modes

* **Tracking-only → Container:** remove your hardcoded pixels, recreate them as tags in **Settings → Pixels & scripts**, and stop setting `enableContainer: false` (it defaults on). One tag, no second script.
* **Container → tracking-only:** set `enableContainer: false`, then hardcode the pixels you need.

## Mobile apps

Neither mode applies to mobile — use the native SDKs (`@datalyr/swift`, `@datalyr/react-native`), which identify users via explicit `identify()` calls.

## Next steps

<CardGroup cols={2}>
  <Card title="Container Installation" icon="download" href="/container/installation">
    Install dl.js (the Container is built in)
  </Card>

  <Card title="Managing Tags" icon="tags" href="/container/managing-tags">
    Configure your pixels and scripts
  </Card>

  <Card title="Container Overview" icon="info" href="/container/overview">
    How the Container works
  </Card>

  <Card title="Web SDK" icon="code" href="/sdks/web">
    init() options including enableContainer
  </Card>
</CardGroup>
