On-site conversions

On-site conversions track actions that happen on your Webflow site. Use them to measure third party form submissions, dynamic interactions, or any custom user action that other goal types don’t capture.

How on-site conversions work

On-site conversions use the wf.sendEvent() API to trigger a goal event. When a visitor performs the action you’re tracking, the event is recorded and attributed to your optimization.

1wf.ready(function() {
2 wf.sendEvent('demo_form_submitted');
3});

Prerequisites

Before tracking on-site conversions, you need to create a custom goal in Webflow.

Example: HubSpot form submissions

In this example, a visitor fills out a form on your site to request a demo. Assumes you’ve created a custom goal in Webflow with the event name demo_form_submitted.

1<!-- Add this to your Page settings Custom Code – before the </body> tag,
2 or to an existing trigger in Google Tag Manager -->
3<script>
4window.addEventListener("message", function (event) {
5 if (event.data.type === "hsFormCallback" && event.data.eventName === "onFormSubmitted") {
6 window.wf.ready(function() {
7 window.wf.sendEvent('demo_form_submitted');
8 });
9 }
10});
11</script>

Example: Calendly meeting bookings

In this example, a visitor books a meeting through an embedded Calendly widget. Assumes you’ve created a custom goal in Webflow with the event name meeting_booked.

1<!-- Add this to your Page settings Custom Code – before the </body> tag,
2 or to an existing trigger in Google Tag Manager -->
3<script>
4window.addEventListener("message", function (event) {
5 if (event.data.event === "calendly.event_scheduled") {
6 window.wf.ready(function() {
7 window.wf.sendEvent('meeting_booked');
8 });
9 }
10});
11</script>

API reference