LogoLogo
Click Here For More Support
  • 📍Get Started
    • Welcome
    • Who We Are
    • Our Product
  • 🤖AI Agent Engine
    • AI Agent Engine Basics
      • Get to Know Your AI Agent Engine
      • Glossary
      • Dashboard Overview
    • Manage Your Content
      • Response Types
        • Prewritten Plus Responses
          • Add New Prewritten Responses
          • Edit Prewritten Responses
          • Enrich Prewritten Responses
          • Response Refiner
        • Generated Responses
          • Web-Scraped Data
            • Troubleshooting
          • Documented Data
          • Enrich Generated Responses
        • Fallback Responses
      • Enrichments
        • Buttons
        • Quick Replies
        • Videos
        • Images & GIFs
          • Best Practices
      • Input Director
        • Copy & Paste Input Training
      • Best Practices
        • Locate Responses/Data
        • Revise Responses
        • Unpublish Responses
        • Content Formatting
        • Suppress Thumbs Up/Down
        • Content Groups
      • Upgrade to Context LLM
    • Install Your Chat
      • Web Installation
        • Advanced Pop-Up Options
      • InApp Webview Installation
        • App Provider Product Overview
        • iOS Advanced Install Guide
        • Android Advanced Install Guide
        • Passing Customer Identifiers
    • Enhance the Chat Experience
      • Pages
        • Add/View Chat Pages
        • Maintain State
        • Avatars
        • Chat Header Image
        • Input Container
        • Chat Background
      • Popups
        • Editor Field Definitions
        • Add/Edit Popups
        • Auto-Open
        • Prompt Bubble
        • Popup Button Image
        • Best Practices
      • Page Themes
        • Field Definitions
        • Adjust Page Themes
      • Activation & Drivers
        • Embed Webpages
        • Link Other Chats
        • Welcome Messages
      • Placement
        • Digital Placement
          • Chat Tile
          • Chat in Chat
        • In-Person Placement
      • Sponsor Inclusion
    • Features & Integrations
      • Channels
        • Facebook Messenger
          • Maintenance & Best Practices
        • Inbound SMS
      • Integrations
        • Ticket Commerce
          • Installation/Maintenance
          • Best Practices
        • Simpleview Integration
          • Listings
          • Events
          • Search Logic Summary
        • Zapier
          • Installation Guide
            • Connect to Salesforce
            • Connect to Google Sheets
        • FEVO
          • Installation Guide
          • Best Practices
        • Carbonhouse Integration
      • Features
        • Multi-Language Functionality
        • Mobile Ticketing Guide
        • Food & Beverage Finder
          • Installation/Maintenance
          • Best Practices
        • Weather Feature
        • Consent Form Feature
        • Satisfaction Score
        • 'Notify Subscription' Feature
    • User Management
      • User Types
      • Adjust User Type & Access
      • Add/Remove a User
      • Update Your Password
      • Unlock Your Account
      • Multi-Factor Authentication
    • Reporting & Analytics
      • Analytics Dashboard
        • Overview
        • AI Chat Performance Dashboard
        • Intent Explorer Dashboard
        • Intent Trends Dashboard
        • Intent Deep-Dive Dashboard
        • Bridge Agent Performance Dashboard
        • Mobile Ticketing Guide Dashboard
      • Data Reports
        • Conversation Transcripts
        • AI Resolutions Log
        • URL Link-Outs
        • Bridge Escalations
        • CSAT Entries
        • Ticket Commerce Records
        • End User Contacts
        • NLP Traffic Log
        • Input and Response Log
        • List URL Subscriptions
        • Get Response Feedback
        • Knowtifi Subscriptions
      • API Report Options
      • External IDs
      • UTM Tracking
      • Security Alerts
  • 📬Marketing Engine
    • Marketing Engine Basics
      • Get to Know Your Marketing Engine
      • Glossary
      • Login to Your Account
    • Marketing Calendar
      • How to Use the Marketing Calendar
    • Segments
      • Segments Overview
      • Uploading Contacts Manually
      • Uploading Contacts in Bulk
      • Importing a File into Unsubscribe List
      • Manage Contact Lists
      • Create Custom Object & Custom Fields for Contact Data Management
      • Contact Engagement Rules
      • Folders
      • Audience
        • Audience Dashboard
        • Audience Filters/Segments
        • Create a Meta Audience
        • Create a Audience Using Marketing Engine
      • Best Practices
        • Use Send Time Optimization
    • Templates & Landing Pages
      • Email Templates
        • Create & Preview an Email Template with Dynamic Content
      • SMS/MMS Template
      • WhatsApp Template
        • WhatsApp Carousel Template
        • WhatsApp LTO Template
        • WhatsApp Product Message Templates
      • Webpush Template
      • Mobilepush Template
      • Landing Page Template with a Form
        • META Pixel Injection on Landing Pages with Form
        • Embed a Landing Page / Form to AI Agent Engine
        • Embedding Customizable Form Tracking Script in Marketing Engine Landing Page
      • Social Conversation Templates
    • Campaigns
      • Messaging Campaigns
        • Select Your SMS/MMS Sender Number
        • How to Create an SMS/MMS Campaign
        • Enable Double Opt-In
        • Messaging Campaign Report
        • Best Practices
        • SMS Regulations
          • SMS Regulations for India
          • SMS Regulations for Canada
          • SMS/MMS Regulations for USA
      • Social Campaigns
      • Email Campaigns
        • Create an Email Campaign
        • Update an Email Campaign
        • Email Campaign Report
        • Smart AI Tools
        • Best Practices
          • Reduce SPAM rate in emails
          • Craft Compelling Email Pre-Header Text
          • Add "View This Email in Your Browser" Link
    • Journeys
      • Overview
      • Journey Blocks
      • Journey Templates
      • Create a Journey
      • Variant Testing
      • Conversion Tracking
      • Campaign or Journey Metadata
      • Advanced Filters for Sorting Campaigns/ Journeys
      • WhatsApp Journey
        • How to Use WhatsApp for Commerce
        • How to Send a WhatsApp One-Way Notification
        • Send a WhatsApp Audio Message
        • Automated WhatsApp Welcome Journey
        • WhatsApp Journey Report
      • Best Practices
        • Email Journey Strategy for Ticket Buyers
        • Journey Examples
    • Settings & Integrations
      • Integrations
        • Ticketing Integrations
          • Ticketmaster Integration
            • Best Practices
          • SeatGeek Integration
          • Glitnir Ticketing Integration
            • Glitnir Integration Use Cases
        • E-Commerce Integrations
          • Shopify
        • Website Tracking
          • Track Your Website
          • JavaScript Tracking Client
          • Track WordPress Websites
          • Track Shopify Stores
          • Enable User ID Tracking
        • Zapier Integration
      • User Management
        • Account Types
        • Add/Remove a User
        • Adjust Role & Access
        • Update Your Password
        • Two-Factor Authentication
      • Settings
        • Add Email Sender Addresses to Launch Campaigns
        • Connect Your Email Domain with the Marketing Engine
        • Connect Your Social Accounts
        • Connect your Shopify Store
        • Integrate Webpush Notifications
        • Setup Segment-based Engagement Rules
    • Factcubes
      • Fan Maturity Model
  • 💬Live Agent Engine
    • Get to Know Your Live Agent Engine
    • System Configuration
      • Installation Guide
      • Escalation Schedule
      • Multiple Team Involvement
      • Leave a Message & Contact Collection
      • Conversation Labels
      • Additional Channels & Placement
        • Bridge Placement
        • Bridge Email
          • Installation Guide
        • Facebook Messenger
    • Agent Overview
      • Logging In
      • Dashboard Overview
      • Profile Setup
      • Notification Preferences
      • Set Your Availability
      • Conversation Status
      • Assign a Conversation
      • Reply in a Conversation
      • Canned Responses
        • Add/Use a Canned Response
        • Modify/Delete a Canned Response
        • Best Practices
      • Participate in a Conversation
      • Private Notes & Mentions
      • Mute/Block a User
      • Prioritize Conversations
      • Resolve a Conversation
      • Export Transcripts
      • Macros/Automation
      • Keyboard Shortcuts
      • Ending Your Shift
      • Troubleshooting
    • Admin Overview
      • Adjust Team Assignments
      • Update Agent Status
      • Additional System Controls
    • Data & Reporting (Bridge)
    • Bridge Mobile App
  • SYSTEM UPDATES & SUPPORT
    • Help Center
    • Release Notes
      • Archived Product Updates
Powered by GitBook
On this page

Was this helpful?

  1. Marketing Engine
  2. Templates & Landing Pages
  3. Landing Page Template with a Form

Embedding Customizable Form Tracking Script in Marketing Engine Landing Page

Last updated 23 hours ago

Was this helpful?

Overview:

This article shows how to embed a JavaScript snippet in a Marketing Engine landing page to send form submissions to a dynamic webhook URL.

Use Case

You want to track submissions of different forms across various landing pages, sending the collected data to different webhook endpoints. This script is configurable for each page by simply changing two variables.

Customizable Script

Paste the following code into an HTML block on your landing page:

<script>
  document.addEventListener("DOMContentLoaded", function () {
    const form = document.getElementById("landingpage_form_{landing_form_id}");
    const webhookURL = "{webhookURL}";

    // List of fields to exclude from webhook
    const excludeFields = [
      "Landing Page Token"
    ];

    if (form) {
      form.addEventListener("submit", function () {
        const formData = new FormData(form);
        const payload = {};

        for (const [key, value] of formData.entries()) {
          if (!excludeFields.includes(key)) {
            if (payload[key]) {
              payload[key] = Array.isArray(payload[key])
                ? [...payload[key], value]
                : [payload[key], value];
            } else {
              payload[key] = value;
            }
          }
        }

        const json = JSON.stringify(payload);
        console.log("Filtered Payload:", json);

        try {
          const blob = new Blob([json], { type: "text/plain" });
          navigator.sendBeacon(webhookURL, blob);
        } catch (err) {
          console.error("Beacon send error:", err);
        }
      });
    }
  });
</script>

How to Use It

  1. Set landing_form_id: Replace the value of landing_form_id with the actual form ID for the landing page you're working on.

  2. Set webhookURL: Replace the placeholder webhook URL with your actual endpoint (e.g., Zapier, webhook.site, internal server).

  3. Paste the Script: Add the complete <script> block into an HTML section of the landing page using the editor’s embed block.

📬