The AJAX form submission event is used to synchronize integrated forms in Connectif and send the "submit" notification to the tool via AJAX.
How to use it
The AJAX "submit" event uses Connectif's JavaScript to send the form submission data via the sendEvents method, making the following call to Connectif:
connectif.managed.sendEvents(events, options)
Example
The notification will look like this:
connectif.managed.sendEvents( [ { type: 'form-submitted', formId: 'ID_DEL_FORMULARIO_INTEGRADO_DE_CONNECTIF', primaryKeyField: 'mi_campo_email', payload: { mi_campo_email: 'test@example.org', mi_campo1: 1234, nombre: 'Test', campo2: 'Esto es una prueba' } } ] )
TROUBLESHOOTING
What happens if the form is not detected by Connectif? There are some cases where Connectif's Integrated Forms tool cannot detect forms on your website, for example:
- The form is on a page that requires authentication.
- The form is built dynamically via JavaScript.
In these cases, we recommend creating a custom integration event to receive data in Connectif.
- Create your custom integration by following the steps in this article.
- Once created, go to the Receive Data tab and click Create new receiving event.
- Assign a name and set the fields to be sent by clicking Add new field.
- Click Save and return to the event list of your custom integration, where you will find the identifier of the newly created event:
- Copy this identifier to use it in the "eventId" field of the following code example to notify Connectif of this event:
connectif.managed.sendEvents( [ { type: 'custom', eventId: 'ID_DEL_EVENTO_PERSONALIZADO_DE_RECEPCIÓN', payload: { mi_campo_email: 'test@example.org', mi_campo1: 1234, nombre: 'Test', campo2: 'Esto es una prueba' } } ] )
Keep learning!
To make the most of your Connectif account, we recommend reading these articles next:
- Add Connectif JavaScript to your website, to insert the code and start collecting information about visits to your site.
- Tag integration, to discover all the notifications you can send from your ecommerce to Connectif and how they work.
- Integration with Connectif via API, to synchronize contacts, products, purchases and vouchers.
- Check the integration with your ecommerce, so you can be confident that your data is syncing correctly with your Connectif account.