Skip to main content

Manual Conversion Tracking & Form Submissions with Saleswings Interactions

Desmond Wolkins avatar
Written by Desmond Wolkins
Updated this week

Advanced Guide: Manual Conversion Tracking & Form Submissions

βš™οΈ This guide is intended for advanced users and developers. It covers scenarios where automatic conversion tracking is not sufficient, such as when using custom-coded forms or needing to manually trigger a conversion event from your own JavaScript.

Manual Conversion Tracking

If your popup contains custom elements that are not automatically tracked (like a form that uses custom JavaScript to submit), you can manually trigger a conversion event. This is typically done using Google Tag Manager (GTM).

The process involves sending a specific command to the SalesWings tracking script.

  1. Ensure the tracking script is on the page: The main SalesWings tracking script must be present on the page where the popup appears.

  2. Create a Trigger in GTM: In Google Tag Manager, set up a trigger that listens for the specific user interaction you want to count as a conversion (e.g., a custom DOM event that your form fires on success, or a specific button click).

  3. Create a Custom HTML Tag: Create a new tag in GTM using the "Custom HTML" type.

  4. Add the Conversion Command: Inside the tag, add the following script. This command explicitly tells SalesWings to record a conversion.

<script>
sw('send-conversion');
</script>
  1. Link the Tag and Trigger: Associate your new tag with the trigger you created in step 2. When the trigger fires, the tag will execute the script and a conversion will be recorded.

Form Submissions and Identity Resolution

For a form submission to identify a visitor and convert an anonymous visitor into a known lead, the form submission event must be sent to the SalesWings backend.

Out-of-the-Box Support
The system provides out-of-the-box identity resolution support for several common form types, including:

  • Sales Cloud Web-to-Lead forms (Need Links)

  • Marketing Cloud CloudPages forms (Need Links)

  • Forms on Braze Landing Pages (Need Links)

Manual Tracking for Custom Forms


​For any other custom form, you can configure tracking using a tag management solution like GTM. This approach allows you to track a submission and fire a conversion event simultaneously.

  1. Create a Trigger: In GTM, create a trigger that listens for the successful submission of your custom form.

  2. Create a Tag with a Custom Script: Create a Custom HTML tag that contains a script to find the email input field, get its value, and send the data to SalesWings.

  3. Example Script: The following example script finds an input field, retrieves the email, and sends the data. You may need to adjust the selector (document.querySelector) to match the HTML of your specific page.

<script>
var emailElement = document.querySelector('input[type="email"]');
if (!emailElement) {
console.log('SalesWings Form Tracking: No email input field found on this page.');
} else {
var email = emailElement.value;
if (!email) {
console.log('SalesWings Form Tracking: Email input field is empty.');
} else {
// This command sends form data AND tracks the conversion
sw('send-form-submit', { email: email }, 'send-conversion');
}
}
</script>

  1. Understanding the Command: The sw("send-form-submit", { email: email }, 'send-conversion'); command is a powerful, combined function call that:

  • Sends the form data ({ email: email }) for identity resolution.

  • Sends the conversion event ('send-conversion') for your analytics.

This approach gives you the flexibility to support virtually any custom form while ensuring that both lead identification and conversion analytics are tracked accurately.


Have any questions or concerns? Feel free to reach out to your Customer Success Manager!

Did this answer your question?