Dot Embed Library

The embed library is our javascript library which will enable you to embed’s experiences on your website.

The standard usage of the Embed Library is to simply embed a page on your website. However you can also use it to communicate back and forth between the page and your website by using the Dot Embed Library Add-On.

There are several options for sending and retrieving information from the embedded page. They are:

  • Initialise the page with URL Data
  • Subscribe to triggered events
  • Get a session data fields value
  • Set a session data field value
  • Run a Custom Action

Bellow it is exemplified all possible use cases of the Dot Embed Library. What is important to note is that upon calling the load method a callback will be called, once the page is ready, with a Page instance. Once you have access to the Page instance you will be able to use it to handle events, actions and data fields.

// page's config
var config = {
  dotId: 155,
  pageId: '60ab77612d249b5070590e07',
  loading: 'on',
  height: 'auto',
  width: '100%',

  // optional url data to send to the page (requires URL Data Add-On)
  urlData: {
    customerId: '123',

window.dotEmbed.load(el, config, function (page) {
  var events =
  var actions = page.actions
  var datafields = page.datafields

  // Subscribe to triggered events.
  events.subscribe('new-lead', function (lead) {

  // Get a session data field value
  datafields.get('counter').then(function (value) {

  // Set a session data field value
  datafields.set('counter', 10)

  // Run a custom action'showButton')

Updated on May 26, 2021

Was this article helpful?

Related Articles