×

Integration of Sparkloop with Checkout Form Submissions in CF 2.0

Created by Education Team, Modified on Tue, 09 Jan 2024 at 06:05 PM by Education Team

This article will review how to add SparkLoop to your pages. SparkLoop is a referral tool for newsletter growth. It allows you to reward your subscribers for sharing your newsletter with their friends.

Even when we don’t have a native integration with SparkLoop, you can still use the app by adding a piece of code in the header area of your pages.

Important Note: Since SparkLoop is not natively supported, our support regarding this integration is limited.

Requirements:


TABLE OF CONTENTS


Script from SparkLoop

To track Sparkloop sign-ups from CF 2.0 checkout forms, you must use the provided JavaScript snippet and add it to the desired page.

This code listens for the checkout state change to 'SUBMITTED' and logs the contact's email, first name, and last name to the console, which can be used for Sparkloop tracking. 

The goal is to ensure that when a user submits a form, the event is captured and reported correctly using Sparkloop.

 Copy the following script exactly as it is shown below:

<script async src="https://js.sparkloop.app/team_************.js" data-sparkloop>

Important Note: Please replace the red asterisks with your Team ID within your SparkLoop app.

<script>
document.addEventListener('cf:form_submitted:ok', (event) => {
if (!window.SL) return;
const contactEmail = event.detail.contact?.email
if (!contactEmail) return;
window.SL.trackSubscriber(contactEmail);
})
</script>

Back to Top


Add the Script to your Page

  1. Locate the page where you want to add the Script and click on Edit to open the Editor.

  2. Click the Code button.

  3. Paste the Script into the Header area.

  4. Save the Changes in the Editor Page.

Important Notes:

1. Test the page by submitting the form and verify that the contact information was transferred.

2. Test this with different payment methods, including Card, Card 3DS, and Paypal.

Back to Top



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article