โ๏ธ Technical prerequisites
The Webmecanik Automation tracking script must be correctly installed on all pages of your website where you want to display dynamic content.
CORS configuration: If your website and your Webmecanik Automation instance are hosted on different domains (e.g.,
mysite.comandautomation.mysite.com), check under Configuration > System Settings > CORS Settings that your web domain is authorized.
๐ ๏ธ Step 1: Create your dynamic content blocks
Log in to your Webmecanik Automation instance.
In the left sidebar menu, click Components, then click Dynamic Content.
Click the New button in the upper-right corner.
Create the default content
Internal name: Give it a clear name (e.g.,
Homepage Banner - Default).Based on a campaign: Leave the toggle set to Yes (this is the standard method for controlling display through the campaign builder). Note: If you set this option to "No," you can define filters directly in the component without using a campaign, but this applies only to identified contacts.
Content: Write your text or insert your HTML/visual code using the editor.
Click Save & Close.
Create the custom variants
Click New again.
Give your variant an explicit name (e.g.,
Homepage Banner - Paris Customers).Enter the content specific to this audience.
Save.
๐ Translation management: If your website is multilingual, you can create primary content in one language, then create a new entry by selecting the original content in the Translate field (to the right of the editor) and specifying its Language. You can then select the specific language in your campaign.
๐ Step 2: Orchestrate display through a campaign
Go to Campaigns > New and open the Campaign Builder.
Contact source: Select the segment containing the contacts who may visit your website (or a global segment grouping your active contacts).
Configure the request and conditions
-
Add the "Request Dynamic Content" decision:
In the Requested Slot Name field (or Requested Slot Name), enter a unique technical identifier without spaces or special characters (e.g.,
homepage_banner).Important: This identifier is the key that links to your website's HTML code.
Select the default content: Choose the block created in Step 1. This content will be pushed if the contact does not meet any subsequent condition.
-
Add your segmentation conditions:
From the Request Dynamic Content decision point, add a Condition (e.g., Contact field value).
Configure your criterion (e.g., the
Cityfield equalsParis).
-
Push the alternative content:
On the Yes branch (green) of your condition, add the Push Dynamic Content action.
Select your dedicated variant (e.g.,
Homepage Banner - Paris Customers).
Publish your campaign and click Save & Close.
๐ป Step 3: Integrate the tag into your website
Open your web page's HTML source code (or use an HTML block in your CMS, such as WordPress, Webflow, etc.).
Paste the following tag where desired:
HTML
<div class="mautic-slot" data-slot-name="homepage_banner">
Content displayed to anonymous visitors or if the script is blocked.
</div>
โ ๏ธ Code considerations:
class="mautic-slot": This CSS class is required. It allows the Webmecanik tracking script to locate the area on the page.data-slot-name: The value must be exactly identical to the one entered in the Requested Slot Name field of your campaign (here,homepage_banner).Content between the
<div>tags: This text or HTML code will always be displayed to anonymous visitors (not identified by a tracking cookie) or while the personalization request is being processed.
๐ Summary of behavior for your visitors
| Visitor type | Conditions met in the campaign | Content displayed on the page |
| Anonymous visitor (unknown) | Not applicable (campaigns run only for identified contacts) |
The content written directly between the <div>...</div> tags on your HTML page.
|
| Identified contact (known) | Yes (e.g., City = Paris) | The custom variant defined in the Push Dynamic Content action. |
| Identified contact (known) | No (e.g., City = Lyon) | The default content defined in the Request Dynamic Content decision. |
Comments
0 comments
Please sign in to leave a comment.