Skip to main content

Marketo Forms

Our HTML Plugin supports tracking submissions from Marketo forms, which function as static HTML forms. The script below will work for Marketo forms embedded directly into your website. If your Marketo form is embedded through a third-party provider like HubSpot, proceed to the next section for a custom script.

dreamdata.load('<DREAMDATA_API_KEY>', {
formTracking: {
html: true,
});

Additional options

We support some additional options for the used HTML tracking. They can be found here.

Handling Marketo Forms via Third-Party Providers

Marketo forms embedded through third-party Marketing Automation Providers like HubSpot require a specific approach for tracking:

Custom Script for Embedded Marketo Forms

Due to their unique client-side JavaScript API, Marketo forms need a special script to ensure accurate tracking.

Instead of the typical html: true setup for static forms, you must use the iframe identification script for these embedded forms:

dreamdata.load('<DREAMDATA_API_KEY>', {
formTracking: {
iframe: true,
});

Then, include this script alongside your embedded Marketo form:

<script
src="https://cdn.dreamdata.cloud/scripts/identify-form/v1/iframe-marketo-identify-form.min.js"
id="dreamdata-marketo-iframe"
data-form-name="some-track-event-name"
></script>

Naming Your Tracking Events

The data-form-name attribute allows you to assign specific names to your tracking events, enhancing the clarity of your analytics reports. For example, for a newsletter sign-up form, you might use the name newsletter-form-submission.