Note: This guide applies to the Starter, Business & Scale plans.
In this article we will be taking a look at on how to embed Trustmary's testimonials and surveys to a website when using Drupal as the content management system. If you're looking for instructions on the same subject but for a different platform, please refer to the other articles in our Help documentation's Integrations section.
Getting the code snippets
Start by navigating to the Widgets section in Trustmary. In there, select a widget or create a new one.
In the widget editor, select the Add to website tab at the top of the screen. Here you'll find the code snippets needed to embed the widget.
What to do with the snippets?
Note, that the two snippets of code serve different purposes.
The first snippet, Trustmary tag, is a global script which enables the loading of the widgets. This script needs to be installed once, either with Google Tag Manager or inside the <head> tag of a website. We recommend installing the script with Tag Manager, as scripts installed like this are activated more reliably. For the installation process, check out this guide.
The second snippet is the embed code itself. This snippet loads a widget into where it is placed on the site.
Embedding the code in Drupal
Start by opening Drupal and clicking on a section on the page you want to edit, marked with a pencil icon and selecting edit in the drop-down menu. Alternatively, you can create a new page through the Content tab and by clicking the Add content button.
Once in the editing view, you are greeted with a text box. First enter a description for the block. Then, select Full HTML as the text format near the bottom of the text box and click the Source button near the top of the text box. Now you can paste the embed code copied previously into the text box.
Don't forget to click Save once you're ready!