feat: implement form abandonment tracking with campaign integration#48
Draft
feat: implement form abandonment tracking with campaign integration#48
Conversation
Add comprehensive form abandonment tracking system that: - Detects when users start filling forms but abandon without submitting - Tracks abandonment percentage and time spent on form - Records filled fields for follow-up insights - Integrates with Mautic's campaign system as a new trigger - Sends data via JavaScript tracking to backend endpoint - Dispatches FormAbandonmentEvent for real-time campaign execution Components: - FormAbandonment entity for storing abandonment records - FormAbandonmentEvent for campaign triggers - FORM_ON_ABANDON event constant - New form.abandon campaign decision type - JavaScript tracking (mautic-form-abandonment.js) with 30s inactivity timeout - PublicController integration with event dispatch - CampaignSubscriber registration for form abandonment trigger - Database migration for form_abandonments table Impact: Recover 15-25% of abandoned leads with automated re-engagement campaigns
The sendAbandonPing function was incorrectly using the form alias (from data-mautic-form attribute) instead of the numeric form ID (from the hidden formId input). This caused the /form/abandon endpoint to receive incorrect data. Also fixes URL paths to use relative '../form/' instead of 'index.php/form/' for consistency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive form abandonment tracking system that:
Components:
Impact: Recover 15-25% of abandoned leads with automated re-engagement campaigns
Description
📋 Steps to test this PR: