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.
</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:
Retrieving Digital embed code
To retrieve a property's embed code:
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.
- 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.
Medallia recommend using a tag manager to add the Digital embed code to a website. See the following sections:
- Embedding Digital code using Google Tag Manager (GTM)
- Embedding Digital code using Adobe Dynamic Tag Manager
- Embedding Digital code using Tealium Tag Manager
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:
- Copy the embed code tag from the Digital property. See Retrieving Digital embed code.
- 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.