Dynamics 365 Marketing Forms
Our automatic form tracking supports tracking embedded Dynamics 365 Marketing forms on your website. It triggers when a valid email is submitted as part of a form.
- Script v3
- Script v2
With script v3, Dynamics 365 Marketing forms are tracked as soon as form tracking is on. Form tracking covers every supported form type, so there is no separate option to enable:
<script>... formTracking: true, ...</script>
To track only some form types, see Choosing which forms are tracked.
To enable Dynamics 365 Marketing form tracking, set the dynamics365Marketing
option to true in your script as done below.
<script id="init-dreamdata">
...
formTracking: {
dynamics365Marketing: true,
},
...
</script>
By default, all your form submission events are labeled as form-submitted.
While functional, this generic naming can complicate your analytics experience.
For instance, distinguishing between events like newsletter-downloaded or
user-signed-up requires correlating each submission with the page URL—a less
than ideal solution.
To streamline your tracking process and enhance clarity, you can map form IDs to
more descriptive names within the dynamics365Marketing configuration object,
as shown here:
<script id="init-dreamdata">
...
formTracking: {
dynamics365Marketing: {
formIdToNameMappings: {
"g3ace55a-a22f-ed11-bba1-000d3ab1d77c": "User logged in",
"some-other-id": "Some event name",
},
},
}
...
</script>
How to Obtain Dynamics 365 Marketing Form IDs
To use descriptive event names effectively, you'll need to retrieve the unique form IDs from your Dynamics 365 forms. Here's how to find them:
- Edit Mode: Open your marketing form in Edit mode.
- HTML Tab: Navigate to the HTML tab.
- Search for ID: Look for the field name you are interested in and identify
the
data-form-block-idattribute which holds the ID, for example:data-form-block-id="g3ace55a-a22f-ed11-bba1-000d3ab1d77c"(Note: Each form has a unique ID.)
Important Consideration
One significant drawback of this approach is that you must manually locate and record the ID for each form you wish to track. This process can be time-consuming and requires access to each form's settings, potentially complicating deployment across many forms or large-scale environments.