Embedding Digital code on a website

To collect feedback using Digital, some JavaScript code must be embedded on the relevant webpages. This embed code is just one HTML tag that references the JavaScript required for a Digital property. Once this tag is embedded on a webpage, you can target Digital surveys on the page, such as intercepting customers or adding an always-on feedback option to the site.

Tip: The tag that contains the Digital embed code should be added at the bottom of the webpage, ideally just before the closing BODY tag (</body>). This ensures that the Digital embed code is loaded later than the other page elements, and can access them. Anything loaded after the embed code cannot be accessed by Digital.

Where you embed the Digital code influences URLs used for targeting. The path to the embed code is considered the domain used for relative URLs. See Specifying URLs for more information.

The following is an example of the Digital embed code:

Example of embed code.

Retrieving Digital embed code

To retrieve a property's embed code:

  1. Log in to Digital Command Center and in the top right corner of the page click the dropdown which contains the property's name. Select the Digital embed code menu item.

  2. In the dialog box that opens, select the HTML tag and copy it to the clipboard. This is the property's unique embed code that is added to the website.

    Embed code to copy and paste.

Medallia recommend using a tag manager to add the Digital embed code to a website. See the following sections:

If you are not using a tag manager, see Embedding Digital code directly.

Embedding Digital code directly

It is not mandatory to use a tag manager to add the embed code. To manually integrate Digital into webpages:

  1. Copy the embed code tag from the Digital property. See Retrieving Digital embed code.
  2. Add the Digital property's embed code to the HTML of each page that you want to target. Alternatively, include the embed code in the footer element of the website to target all pages.