You can use our AFL UTM Tracker plugin and a HTML wrapper code to populate UTM parameters into iframe-based Embed Forms.
This documentation is for SaaS-based forms (e.g Zoho, Jotform). The forms must have support for the feature below. These terms mean the same and are often used interchangeably.
- Pre-populate Form Fields
- Pre-fill Form Fields
- Dynamically Populate Form Fields
Minimum Requirements
- AFL UTM Tracker v2.23.0
- WordPress v5.0.0
Enable the Javascript Merge Tag Feature
- Login to your WordPress admin dashboard.
- Go to our AFL UTM Tracker > Settings page.
- Under the Attribution section, enable the “Javascript Merge Tag” feature.
- Save and clear all page cache.
HTML Wrapper Code
You will need to use our HTML wrapper to surround the HTML iframe tag which you have obtained from the SaaS-based form builders.
If the form builders have include additional files like CSS files, you need to place it outside of our HTML wrapper.
Basic HTML Wrapper Code
Advanced HTML Wrapper Code
Configuration
data-afl_utm_src
This attribute is for the purpose of remembering the original src path. Copy the src=”” value from the original HTML iframe tag and paste into the data-afl_utm_src=””.
data-afl_utm_src_type
- Accepted values are “script” or “iframe”.
- Since this is a iframe-based form, we will set the value as “iframe”.
data-afl_utm_src_suffix
- This is the URL query format to be passed to the form.
- It supports using our Javascript Merge Tags. Each Merge Tag must be surrounded the curly brackets.
- Each parameter will need to correspond to the respective hidden field name (not label name) created on the form builder’s website. Please read the form builder’s documentation on “Pre-populating form fields”.
For example, if you want to passed the GCLID value to your form:
data-afl_utm_src_suffix="utm_source={afl_utm_js:utm_source}&utm_medium={afl_utm_js:utm_medium}&utm_campaign={afl_utm_js:utm_campaign}&utm_term={afl_utm_js:utm_term}&utm_content={afl_utm_js:utm_content}&gclid={afl_utm_js:gclid_value}"
data-afl_utm_src_optout
Accepted values are “1” or “0”. It works hand-in-hand with Cookie Consent Banner.
- “1” means the visitor can deny UTM parameter tracking. No attribution will be passed to the form.
- “0” means the visitor cannot deny UTM parameter tracking after accepting. This will help to prevent the form from reloading after consent is denied.
- The default value is “1” when the property is not provided.
data-afl_utm_src_optout_use_default
Accepted values are “0” or “1”. This option affects only when the consent is denied.
- “0” means disable our Javascript Merge Tag “default” value filter.
- “1” means enable our Javascript Merge Tag “default” value filter.
- The default value is “0” when the property is not provided.
When consent is denied, all Javascript Merge Tag value will be empty. But if you need to have a specific fallback value when consent is denied, then use the default value filter in the data-afl_utm_src_suffix attribute.
data-afl_utm_src_suffix="utm_source={afl_utm_js:utm_source|default:hello}"
data-afl_utm_src_optout_value
Accepted value is a string. Set a value if you want to have a default value for all parameters (using our Javascript Merge Tags) when the consent is denied. For example:
data-afl_utm_src_optout_value="deny"
data-afl_utm_src_optout_value="NA"
When the visitor denies consent, the following URL query will be send to the form:
https://www.form-url.com/?utm_source=deny&utm_medium=deny&utm_campaign=deny.....
data-afl_utm_src_optout_suffix
You can use a URL query format just for visitors who denied consent. This will overwrite the data-afl_utm_src_suffix attribute.
data-afl_utm_src_optout_suffix="consent=deny"
When the visitor denies consent, the following URL query will be send to the form:
https://www.form-url.com/?consent=deny