JavaScript event integration is the most advanced custom integration option with Connectif and allows greater control over when and how events are sent. It involves sending notifications directly via JavaScript, using the Connectif global object and the functions it offers.
How to integrate Connectif using JavaScript events
You can use this integration to configure the sending of information about what happens on your website, however you must complement this method to synchronize your catalog and configure the Web Push.
1. Add Connectif JavaScript
Configure the Connectif JavaScript on the web to load on all pages and integrate via events.
2. Configure sending information via JavaScript events
Initialize and configure the Connectif JavaScript to get all the information:
3. Report event submissions
Configure the events that will notify Connectif of what happens on your website:
- "Contact Information" tag: to log the data of ecommerce visitors.
- Cart information notification: to describe the contact’s shopping cart at a given time.
- Page visited notification: to report that the contact has visited a page while browsing the website.
- Product visited notification: to report that the contact has visited a specific product while browsing the website.
- Notification of purchase made: to register purchases made by the contact.
- Notification of search performed: to indicate that a search has been performed and to identify the terms used.
- Login notification: to indicate that the contact is logged in.
- Registration notification: to indicate a new registration.
- Newsletter subscription notification: to indicate that a contact has subscribed to the newsletter.
4. Synchronize the product catalog
Product verification does not support sending JavaScript events, as the Connectif product verifier expects to get the "cn_product_visited" tag when visiting the product URL.
You can synchronize your catalog using two different methods:
- Implement the Visited Product tag with rendering on the server.
- Disable automatic product verification and synchronize the catalog via API.
5. Configure Web Push notifications
To complete the integration you will also need to configure the Service Worker to receive Web Push subscriptions and send notifications to your contacts.
6. Validate the integration
Once you’ve implemented the sending of information to Connectif, the next step is to confirm that the integration has been carried out correctly.
Keep learning!
To make the most of your Connectif account, we recommend reading these articles next:
-
Onboarding, to learn all about our interface.
-
Initial workflows, to implement your first strategies in your account.
-
Integrations with external systems, to integrate your Facebook, website forms and webhooks.
-
API integrations, to administrate events such as order registration or contact sign-ups.