Embedding on External Websites
Show personalized Mautic content on your website or share it via a direct link using Twig Templates.
You can use your Mautic Twig Templates not just in emails and landing pages, but also directly on your own website or share them using a special link. This lets you put personalized Mautic content anywhere on the web.
Mautic provides two ways to do this when you view a saved Twig Template:
Embed with Javascript
Add personalized Mautic content directly onto your website pages (like banners or messages). Mautic gives you a Javascript code snippet to paste into your site’s HTML.
How to Get the Code:
Example Snippet:
How it Works:
- Paste the snippet into your website’s HTML where you want the content to appear.
- The script fetches and displays the Twig Template’s output when the page loads.
- Personalization is based on the visitor’s Mautic tracking cookie. If the visitor is unknown, any default values or fallback logic in your template are used.
Remember to replace https://your-mautic.com
with your Mautic URL. The {TEMPLATE_ID}
and {UNIQUE_HASH}
are unique to your template and provided by Mautic.
Use Direct Link
Get a unique URL that displays your rendered Twig Template as a standalone HTML page.
Useful For:
- Quickly previewing template output.
- Embedding content using an
<iframe>
on another site. - Sharing a specific piece of personalized content directly.
How to Get the Link:
Example Link:
How it Works:
- Anyone visiting this link will see the rendered HTML output of your Twig Template.
- Personalization is based on the visitor’s Mautic tracking cookie (if they have one).
Replace https://your-mautic.com
, {TEMPLATE_ID}
, and {UNIQUE_HASH}
with the actual values provided by Mautic for your specific template.
Using these embedding options helps you extend Mautic’s personalization power beyond emails and landing pages.