Skip to main content

Installation

The Break Ground SDK is a client-side JavaScript snippet loaded via a <script> tag. It loads asynchronously and does not block page rendering.

Embed Snippet

Add the following snippet inside the <head> section of your HTML:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Your Application</title>

<!-- DAP SDK Snippet -->
<script>
(function (w, d, s, o, f, js, fjs) {
w["DAPObject"] = f;
w[f] =
w[f] ||
function () {
(w[f].q = w[f].q || []).push(arguments);
};
w[f].l = 1 * new Date();
js = d.createElement(s);
fjs = d.getElementsByTagName(s)[0];
js.id = f;
js.src = o;
js.async = 1;
fjs.parentNode.insertBefore(js, fjs);
})(window, document, "script", "https://cdn.example.com/sdk.js", "DAP");
DAP("init", { tenantKey: "YOUR_TENANT_KEY" });
</script>
</head>
<body>
<!-- Your application content -->
</body>
</html>

Replace YOUR_TENANT_KEY with the API key from your dashboard (Settings > API Keys).

How the Snippet Works

The IIFE performs the following steps:

  1. Registers a global DAP function on window that queues any calls made before the SDK script has loaded.
  2. Creates a <script> element pointing to the SDK bundle and inserts it into the page.
  3. Sets async=1 so the script loads without blocking the page.
  4. Once the SDK script loads, it processes the queued calls — starting with the init command.

Initialization

The DAP('init', config) call accepts a configuration object. At minimum, you must provide your tenantKey:

DAP("init", { tenantKey: "YOUR_TENANT_KEY" });

For additional options such as debug, locale, and journeys, see the SDK Configuration reference.

Verifying the Installation

After adding the snippet, confirm the SDK loaded correctly:

  1. Open your application in a browser.
  2. Open the developer console (F12 or Cmd+Option+I).
  3. Type window.DAP and press Enter. If the SDK is loaded, you will see the DAP function object.
  4. Enable debug mode to see detailed logs in the console:
DAP("init", { tenantKey: "YOUR_TENANT_KEY", debug: true });
  1. Check the Network tab for a successful request to the SDK bundle URL.

If window.DAP is undefined, verify the snippet is placed inside <head> and that no script errors appear in the console.

Framework-Specific Installation

Using a JavaScript framework or CMS? See the Framework Installation Guides for step-by-step instructions for React, Next.js, Angular, Vue.js, WordPress, and Google Tag Manager.