Information for: DEVELOPERS   PARTNERS

Dynamic web content

Dynamic web content is one of several methods Campaign Studio uses to personalize the web experience for their contacts. Marketers can display different content to different people in specific areas of a webpage. Campaign Studio users may want to personalize content based on data collected about the website visitor. Even anonymous contacts may see dynamic content, if you’ve collected any information about them (such as location data).

Preparing for personalization


Before you can create personalized content, consider:

  • Where on your website or webpage would you like to include personalized content?
  • What audience(s) would you like to personalize content for?
  • Do you have the necessary information in your database, enabling Campaign Studio to identify who should see your personalized content?

Campaign Studio configuration

In order for Campaign Studio to pass information back and forth with your website, you must configure your CORS settings.

  1. Navigate to Settings > Configuration > System Settings.
  2. In the CORS Settings section, ensure Restrict Domains is set to Yes (default). Restricting your domains ensures your Campaign Studio instance isn’t accessible to the internet.
  3. In the Valid Domains field, =dd the domains you’re using with your Campaign Studio instance. Include any domains using dynamic content.

System Settings - CORS Settings

Website preparation

Once you’ve determined where on your website you’d like to display personalized content, you must create an area to add the content. Campaign Studio is CMS-agnostic; add a dynamic web content slot to any website you’ve created. To do this, create an HTML slot where the dynamic content will display.

Creating content

Default content

Default content is the content visitors see when they don’t meet the criteria you’ve set for dynamic web content, or aren’t tracked as a known contact. You want to have content in the section of the page you’ve set aside for personalization rather than a empty area. Build the content directly on your site.


If you’re using focus items as your dynamic content and only showing specific focus items to specific audiences, you don’t need default content. Focus items are pop-ups which don’t take up an area on your page.

Dynamic content

Campaign Studio has both campaign-based and non-campaign-based dynamic web content. To create either:

  1. Go to the Components section of Campaign Studio
  2. Select Dynamic Web Content.
  3. Click +New to create a new slot. The New Dynamic Content page displays. New DWC Slot
  4. Enter values for the following fields:
    • Internal Name (Required): How the slot displays in your list of dynamic web content slots. Acquia recommends including information on the data point(s) you’re personalizing (for example, country), and the content in the slot (for example, United States). If you were creating a personalized slot for people in the United States, you can name the slot Country - United States. If you plan to have more than one personalized content slot for the same audience across your website, include the page title or other identifying information for the particular slot.
    • Content (Optional): Use the WYSIWYG builder to create the dynamic content slot. You may include images and videos. If you prefer HTML, click the </> icon in the toolbar to switch to the code view. Campaign Studio’s dynamic web content supports tokens like in landing pages or emails. To add a token, click the tag icon in the WYSIWYG toolbar. Supported tokens include:
      • Contact field: {contactfield=fieldalias}
      • Landing page link: {pagelink=ID#}
      • Asset link{assetlink=ID#}
      • Form: {form=ID#}
      • Focus item: {focus=ID#}
    • Category (Optional): You can organize your dynamic content slots based on their goals, campaigns, etc. For more information, see Global Categories.
    • Language (Optional): Campaign Studio enables marketers to present content in multiple languages. You may use the same slot, display the content in various languages depending on the country where a contact is accessing the content from. To create content in a more languages, select the language you’re creating a variant in.
    • Is a translation of (Optional): If you’re creating a slot in a second language translation, select the original slot you’re translating. The same slot will display, based on either a campaign or filters you’ve set, but the content will be translated if a visitor is viewing the page where the slot is in a country where a different language is used.
    • Published (Optional): When set to Yes, a dynamic content slot displays on your website. When set to No, visitors see the default content.
    • Is campaign based? (Optional): When set to Yes, you can push a dynamic content slot to a contact based on them viewing a specific page within a campaign. When set to No, you can select filters for visitors to meet specific criteria to see the content.
    • Requested slot name (Required): For non-campaign-based dynamic content, the name used in the code added to your website. Or, the name you use to add a dynamic web content slot to a Campaign Studio landing page. It’s possible to have multiple slots for the same data point, so the name is often generic (for example, country). Acquia recommends referencing the slot name in the item name as well.
    • Google Analytics UTM tags (Optional): Use UTM tags to track your leads which convert from dynamic web content slots, and indicate the lead source in Google Analytics or Campaign Studio reports. For more information, see UTM Tags.
  5. Click Save to finish, or Cancel to discard your changes.

Campaign-based dynamic content

Decision - Request Dynamic Content

Request Dynamic Content

Use a Campaign Decision for Request dynamic content to use campaign-based dynamic content. The Campaign Decision checks if a campaign member visits a page where a dynamic content slot is. Visitors to a page a dynamic web content slot exists will receive the dynamic content.

To create the dynamic content request:

  1. Enter a Name. The name is the for the campaign event. Start the name with something like Req-DWC: so when you’re looking at campaign reports, you can see the event type.

  2. Enter a Requested Slot Name. Campaign Studio checks for the slot name. You can see how many contacts got to the campaign event where you’re checking if their visits request the slot.

    For example, Req-DWC: Country-Header. The requested slot name is the slot Campaign Studio looks for on the page. If it’s on a 3rd-party page, it’ll be in the code you use to add the dynamic content slot to your page. If it’s on a Campaign Studio landing page, define the slot name on the landing page.

  3. Choose an item from the Select Default Content menu. The content chosen here displays to visitors who don’t meet the conditions set at the next stage of the campaign. Users may see the default content first, before Campaign Studio pushes the dynamic content.

  4. Select +Add to add the request, or Cancel to discard the changes.

Condition - filter

Campaign Condition - Contact Field Value

To decide which dynamic content slot you want to push, you must have a filter within the campaign. This happens with Conditions. You may use any condition type to see if a contact meets whatever criteria is relevant to the dynamic content slot.

Action - Push dynamic content

Campaign Action - Push Dynamic Content

This action type appears as an option later in a campaign than the Requests dynamic content decision event. If a contact meets the condition, Campaign Studio pushes the personalized content for the criteria.

When using this campaign action:

  1. Add a name for the action. Best practices start the name of the event with DWC: and include the name of the slot you’re pushing. For example, DWC: Country-Header-US.
  2. In the Select Dynamic Content menu, choose the slot from your Dynamic Web Content slot list you’re going to push. The slots you’ve set as campaign-based in the selection list display. If you haven’t created a slot, click *+New Dynamic Content to a new window and create a slot.
  3. When finished, click Update to save, or Cancel to discard your changes.

You may set up multiple conditions following the decision, with a different DWC slot on the Yes path for each. If the contact doesn’t meet any of the conditions, they’ll see the default content selected in the decision. Visitors will also see the default even if you don’t have anything on the No path for the condition. Here’s what a sample campaign sequence looks like:

Campaign - Dynamic Content Sequence

Non-campaign-based dynamic content

Filter-based DWC

Using a filter is the recommended way to use dynamic web content, as filters are often easier to configure.

  1. Go to the Filters tab.
  2. Configure the criteria contacts must meet to see the DWC slot.

Any time a contact visits a page you’ve added the slot to and meets those filters, Campaign Studio displays the personalized slot.

Implementing dynamic web content

Users may add dynamic web content either to a Campaign Studio landing page, or to an external website.

Campaign Studio landing pages

  1. Drag in a text block.
  2. Using the Merge Tags menu from the text editor, select the name of the slot that you want to display on the page. The builder populates with a token formatted as {dwc=slotname}.

If a visitor is unidentified or does not meet the criteria for the dynamic web content, no content displays in that area of the landing page unless a slot with opposite filters is created using the same slot name.

In campaign-based dynamic content, when a visitor who is a contact in the campaign hits a page containing the dynamic web content slot configured in the campaign decision, the visitor will see dynamic content. In filter-based dynamic content, visitors will see the dynamic content for the slot with the same name for which they meet the criteria. On a landing page, use the slot name for the dynamic content that you want to show. Even if you have multiple slots with the same name, Campaign Studio will match the visitor to the filters for each slot and display the appropriate slot.


When editing a landing page in Code Mode, either enter the token for {dwc=slotname} or use the code indicated in the External websites section.

External websites

When building your page, you must create the area to personalize. In that area, add the following HTML tag:

<div data-slot="dwc" data-param-slot-name="slotname">
<h1>Default content</h1>
  1. Replace slotname with the slot name you create in the campaign or on the non-campaign-based DWC slot.
  2. Add your own default content between the <div> tags to ensure content displays, even if a contact isn’t known or doesn’t meet the criteria you’ve set up. The plugins for Joomla! and Wordpress use shortcodes to enter dynamic web content.
    • Joomla!: {mautic type="content" slot="slotname"} Insert default content {/mautic}
    • Wordpress: [mautic type="content" slot="slotname"] Insert default content [/mautic]