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:1
Go to your saved Twig Template in Mautic.
2
Find and click the “Embed Twig Template” option.
3
Copy the Javascript code snippet provided.
- 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.
1
Go to your saved Twig Template in Mautic.
2
Find and click the “Embed Twig Template” option.
3
Copy the “Direct HTML link” provided.
- 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.