Custom HTML Creative
What's on This Page:
About Custom HTML Creatives
Most of the commonly used Creatives will overlay content on your website. The Custom HTML Creative is unique in that it allows you to create custom content that is displayed as part of your page. This custom content can be anything from an advertisement to an embedded survey.
In this screenshot, a survey appears embedded in the web page after a visitor completes a payment. The survey is built in the Survey Platform and embedded on the page using a Custom HTML Creative.
Custom HTML Creatives can also be useful for content management, allowing you to choose which surveys are shown to specific types of website visitors. For example, you could choose to display a discount offer only to those visitors located in areas near physical store locations, and alternate material to everyone else.
Implementing Custom HTML
- Generate a Custom HTML Creative.
- Have your web team designate a “container” on your website where your Custom HTML will be inserted. This space should include an HTML element with an ID attribute. Identify and copy the HTML ID between the quotation marks.
In many cases, an HTML tag with an ID already exists in the proper location, and no site modifications are necessary.Qtip: Use your browser’s “Inspect Element” function to determine the HTML ID of an element. In most browsers, simply right click on the portion of the page you would like to inspect, and select “Inspect” or “Inspect Element.” - Create an Intercept.
- In the Options menu of your Intercept’s action, select Advanced Options.
- Paste the HTML ID of your target container into the Creative Insertion Point field.
- Click Save.
- When a visitor comes to this page on your website, Qualtrics will search for the HTML element with the ID you specified, and insert your Creative in that div container.
Custom HTML Options
In the Creative Options menu, you will find settings specific to Custom HTML Creatives.
Custom positioning
Sometimes your Custom HTML Creative may be smaller than the target container where it will be inserted on your website. In this case, you can use Custom Positioning to specify where in relation to the target container your HTML will display.
For even more control over positioning, you may Offset the X or Y position of the Creative from its initial position or select Fix to Page so the Custom HTML follows the visitor as they scroll.
Replace target container contents
By default, when a Custom HTML Creative is inserted into a page, it replaces the existing content of the target HTML element. You’ll see this option selected as Replace target container contents.
Append to target container
Rather than replacing the target container contents, you can select Append to target container to place your Creative within the target container, but after any existing content.
Insert before target container
This option allows you to insert the Custom HTML Creative before the target container.
Insert after target container
This option allows you to insert the Custom HTML Creative after the target container.
A Note On Z-Index
Z-index is a CSS property that specifies which elements on your web page should be on top when elements overlap. By default, Creatives will have a higher z-index than other elements on your page so that they are always on top.
This is usually best, but in some cases this may not be preferable. For example, a dropdown menu might be covered by your Custom HTML.
To adjust the z-index of your Custom HTML:
- Go to your web page that displays the Creative and open the Developer Tools or Inspect Element tool.
- Identify the div class beginning with “QSI”, and copy what is between the quotation marks. Then, replace the space between “QSIUserDefinedHTML” and the string beginning with “SI_” with a period (.). In the example below, we would copy:
QSIUserDefinedHTML SI_4PEs8K4EkCbmSdT_UserDefinedHTMLContainer
and then after replacing the space with a period, we now have:
QSIUserDefinedHTML.SI_4PEs8K4EkCbmSdT_UserDefinedHTMLContainer
- In your Qualtrics account, go the Edit Creative section for your Creative.
- Double click on any element to modify it or create a new blank one.
Warning: We recommend against adding the Z-index CSS element to an embedded target because you may have issues with other parts of your page getting accidentally covered. However, adding Z-index to other element types is okay.
- Click Source at the top of the Rich Content Editor to enter the HTML view.
- Take the code below (including the style tags) and paste it into the source.
<style="text/css"> .QSIUserDefinedHTML{z-index:1;} </style>
- Replace the “QSIUserDefinedHTML” with the ID you retrieved in Step 2 and replace the z-index value with whatever is appropriate for your webpage.
<style="text/css"> .QSIUserDefinedHTML.SI_4PEs8K4EkCbmSdT_UserDefinedHTMLContainer{z-index:1;} </style>
- If the project code is already in your website’s source code, click the Publish Creative button to push your changes to your site.
- If the code is not in your website’s source code, you can test the Creative on your website using Test Intercept and confirm that everything is layered properly.
- If the layering still is not right, you may consider changing the z-index value to a larger number in order to stack your Creative higher on the page, or a smaller (even negative) number to stack it lower.