After you have completed the steps of your Connectif integration with VTEX Legacy if you have a newsletter signup form in your web store, you can integrate it with Connectif to collect this event in real time.
In this article we explain how to implement the contact subscribed to the newsletter event.
Difficulty: Low (knowledge of Google Tag Manager is required).
When to use it: When you open your Connectif account.
STEP 1. Creating the GTM cn_newsletter_subscription event
1. Locate the form you want to associate with the event.
2. Perform the following push to the dataLayer when the user subscribes to the form:
dataLayer.push({
'event': 'cn_newsletter_subscription',
'emailNewsletter': 'test@example.org'
});
<form onsubmit="dataLayer.push({'event': 'cn_newsletter_subscription',
'emailNewsletter': document.getElementById('email').value});">
Enter your email: <input type="email" id="email">
<input type="submit">
</form>
STEP 2. Verifying the integration
3. Browse your website and subscribe to the newsletter.
4. Once subscribed, log in to your Connectif account.
5. Go to "Contacts > View all" and look for the email address you have subscribed to.
6. Once located, click Details.
7. Go to the Activity tab of the contact form and check that the "Entity subscribed to the newsletter".
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.