How It Works

Find out how our solution helps you turn browsers into buyers.

Integrations

From Shopify to Klaviyo, explore over 80 integrations.

Support

Access guides, troubleshooting, and expert assistance.

About Us

Hear our origin story and meet our team.

Careers

Explore career opportunities with Retention.com.

Events

See upcoming events we’re hosting or attending.

Referrals

Got a referral? Let us know here.

This guide is here to help you quickly set up and use Grow and Reclaim scripts with Funnelish.

Due to the specific functionality and primary objective of Funnelish, our Reclaim functionality is available for Add to Cart events and does not include Viewed Product events.

Where to find your collection snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes.

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add Grow Script & Code Snippet

1. Log in to your Funnelish account. From the navigation, click Funnels and select the appropriate funnel.

2. Click the Funnel Settings Icon from the bottom left navigation and then click Custom Codes on the right.

3. Click on Create a new code under "Tracking Codes".

4. Proceed to fill in the form for adding new tracking code. Give the script a name, ensure "Lazy Load" is toggled off, and select "Append to page head" for code placement. Paste your Collection Snippet in the code block below and click "Create code".

5. Close the custom code section and click on "Save Changes" in the funnel settings screen.

Click here to learn how to test your script.

How to add Reclaim Script (add to Cart)

Note: This requires the Grow Script to be installed!

1. Navigate to your Funnels page, find and click on your landing page from the menu on the left and then click on "Edit Page".

2. Click on the three dots (...) located at the top left navigation bar to bring up the "More actions" menu then select "Custom Codes".

3. Click on the "Custom JS (Body)" tab. Copy and paste the Reclaim code snippet (provided below) into the code area. 

Note: Ensure you update the payload with the correct product information and click "Save Changes". 

4. Close the Custom Code window and save your changes by clicking the button on the top right of the screen. 


Reclaim Code Snippet

NOTE: You will be required to update the "item" variable in the code below with all the appropriate product information.

We recommend you use the following fields*:

*These are fields to be used in your maretking emails and must match the variables you expect to use in your email platform. Add/remove as required.

<script defer type="text/javascript">
// create payload of the item - these will populate your emails
// ** UPDATE THE VARIABLE BELOW WITH YOUR PRODUCT INFORMATION **
var item = {
    Name: "Product Name",
    Price: 0,
    ProductID: "ProductID",
    Categories: "Category",
    ImageURL: "ProductImageURL",
    URL: window.location.href,
    Brand: "Brand" 
};

// Call our event once DOM is loaded 
document.addEventListener('DOMContentLoaded', function () {
    // *NOTE* ---- please use the appropriate selector for the Buy Now button on your page. i.e. a[href="#next-step"]
    var addToCartButton = document.querySelector('a[href="#next-step"]');
    if (addToCartButton) {
        addToCartButton.addEventListener('click', function () {

            if (window.location.href.includes('vge=true')) {
                console.log("add to cart clicked;");
            }
            // Call addToCart event
            geq.addToCart(item);
        });
    }
});
</script>

Disclaimer

These scripts attempt to utilize the capabilities offered by Funnelish and are intended to be lightweight and perform well in the majority of scenarios. We understand that every website is unique and as such, variations may be required by your team. 

This feature can identify viewed products and add to cart events for both unknown, non-logged in users (Grow contacts) and known, non-logged in customers (emails in your Grow suppression list). 

To use this feature, you must have the most recent version of our script on your website. You can find your script in your account under Code Script > View Script.
Click here for a link to the tutorial on how to add the script to your site, in case you need a refresher.

What you'll need

Copy the code block below. This code will be added into your BigCommerce theme and captures key product details and creates a payload for Retention Reclaim events. 

How does it work?

The code injects key product details into the template through the use of BigCommerce handlebars. The subsequent JavaScript script parses the BigCommerce object and generates a payload for the viewed product and add to cart events.

Upon the DOM being fully loaded, the script initiates the 'Viewed Product Reclaim' event. If an 'Add to Cart' button is present, an event listener is set up to capture the 'addToCart' event when clicked.


{{inject 'productInfo' product}}

<script defer type="text/javascript">
// grab BigCommerce Data
var jsContext = JSON.parse({{jsContext}});
    
// create Retention payload object
var vpitem = {
    Name: jsContext.productInfo.title,
    Price: jsContext.productInfo.price.without_tax.formatted,
    ProductID: jsContext.productInfo.id,
    Categories: jsContext.productInfo.category[0],
    ImageURL: jsContext.productInfo.main_image.data.replace("{:size}", jsContext.productSize),
    URL: window.location.href,
    Brand: jsContext.productInfo.brand ? (jsContext.productInfo.brand.name ? jsContext.productInfo.brand.name : '') : ''     
};

// Output to console in Retention debugger mode only
if (window.location.href.includes('vge=true')) {
    console.log("BigCommerce Data", jsContext);
    console.log("Payload for Reclaim events", vpitem);
}

// Call Retention Reclaim events once DOM is loaded 
document.addEventListener('DOMContentLoaded', function () {
    // Call Product Viewed Reclaim event
    geq.event('Viewed Product Reclaim', vpitem);

    // *NOTE* ---- please use the appropriate selector for the Add to Cart button 
    // var addToCartButton = document.getElementsByClassName("form-action-addToCart");
    var addToCartButton = document.getElementById("form-action-addToCart");
    if (addToCartButton) {
        addToCartButton.addEventListener('click', function () {
            // Output to console in Retention debugger mode only
            if (window.location.href.includes('vge=true')) {
                console.log("add to cart clicked;");
            }
            // Call addToCart Reclaim event
            geq.addToCart(vpitem);
        });
    }
});
</script>

This section pertains specifically to scenarios in which users have the option to add other items to their shopping cart directly from a product page.

How does it work?

When a user adds another product to their cart directly from a product page, we have two solutions that allow us to capture the Reclaim add to cart event. For the first solution, we implement an event listener to capture this action and subsequently create a temporary cookie in the browser. Upon redirection to the cart, we perform a check to verify the presence of the cookie. If it exists, we utilize the information of the latest item added to the cart to trigger the Reclaim addToCart event. For the second solution, we create a listener for the Big Commerce "cart/add" endpoint and create a payload from that response for the event. 

Code Snippet 1: Use this if the page redirects after add to cart event
{{inject 'productInfo' product}}

<script defer type="text/javascript">
// grab BigCommerce Data
var jsContext = JSON.parse({{jsContext}});
    
// create Retention payload object
var vpitem = {
    Name: jsContext.productInfo.title,
    Price: jsContext.productInfo.price.without_tax.formatted,
    ProductID: jsContext.productInfo.id,
    Categories: jsContext.productInfo.category[0],
    ImageURL: jsContext.productInfo.main_image.data.replace("{:size}", jsContext.productSize),
    URL: window.location.href,
    Brand: jsContext.productInfo.brand ? (jsContext.productInfo.brand.name ? jsContext.productInfo.brand.name : '') : ''     
};

// Output to console in Retention debugger mode only
if (window.location.href.includes('vge=true')) {
    console.log("BigCommerce Data", jsContext);
    console.log("Payload for Reclaim events", vpitem);
}

// Call Retention Reclaim events once DOM is loaded 
document.addEventListener('DOMContentLoaded', function () {
    // Call Product Viewed Reclaim event
    geq.event('Viewed Product Reclaim', vpitem);

    // *NOTE* ---- please use the appropriate selector for the Add to Cart button 
    // var addToCartButton = document.getElementsByClassName("form-action-addToCart");
    var addToCartButton = document.getElementById("form-action-addToCart");
    if (addToCartButton) {
        addToCartButton.addEventListener('click', function () {
            // Output to console in Retention debugger mode only
            if (window.location.href.includes('vge=true')) {
                console.log("add to cart clicked;");
            }
            // Call addToCart Reclaim event
            geq.addToCart(vpitem);
        });
    }
    
    // This code is for instances where supplementary items are added to the shopping cart directly from a product page.
        
    // *NOTE* --- please use the appropriate selector for the Add to Cart button 
    var otherProducts = document.getElementsByClassName("button--small card-figcaption-button");
    // Convert the HTMLCollection to an array
    var otherProductsArray = Array.from(otherProducts);
        
    // Add an click event listener to each product
    otherProductsArray.forEach(function (product) {
      product.addEventListener('click', function (event) {
        // Set a cookie named _geapc that expires in 1 minute
        const expirationDate = new Date();
        expirationDate.setTime(expirationDate.getTime() + 60 * 1000); // 1 minute
        document.cookie = "_geapc=true; expires=" + expirationDate.toUTCString() + "; path=/";
      }); // end of click event listener for other products
    }); // end of otherProducts check
});
</script>

<script defer type="text/javascript">
// Check if the "_geapc" cookie exists
if (document.cookie.includes('_geapc=true')) {   
    // Grab BigCommerce Data
    var jsContext = JSON.parse({{jsContext}});
    
    const options = { method: 'GET', headers: { 'Content-Type': 'application/json' } };
    fetch(jsContext.secureBaseUrl + '/api/storefront/carts', options)
        .then(response => {
            if (!response.ok) {
                throw new Error("Call to cart failed");
            }
            return response.json();
        })
        .then(data => {
            if (data.length > 0) {
                // Get the last item added to the cart
                var lastAdded = data[0].lineItems.physicalItems[data[0].lineItems.physicalItems.length - 1];
    
                // Create new payload for reclaim ATC 
                var lastItem = {
                    Name: lastAdded.name,
                    Price: lastAdded.listPrice,
                    ProductID: lastAdded.id,
                    Categories: '',
                    ImageURL: lastAdded.imageUrl,
                    URL: lastAdded.url,
                    Brand: lastAdded.brand ? (lastAdded.brand ? lastAdded.brand : '') : ''
                };
                console.log(lastItem);
                
                setTimeout(() => {
                    // Call Reclaim ATC function
                    geq.addToCart(lastItem);
                }, 2000); // 2 second delay before calling the Reclaim ATC function
            }
        })
        .catch(err => console.error(err));
} else {
    console.log("Cookie _geapc not found. API call not made.");
}
</script>
Code Snippet 2: Use this if the page doesn't redirect to the cart
{{inject 'productInfo' product}}

<script defer type="text/javascript">
// grab BigCommerce Data
var jsContext = JSON.parse({{jsContext}});
    
// create Retention payload object
var vpitem = {
    Name: jsContext.productInfo.title,
    Price: jsContext.productInfo.price.without_tax.formatted,
    ProductID: jsContext.productInfo.id,
    Categories: jsContext.productInfo.category[0],
    ImageURL: jsContext.productInfo.main_image.data.replace("{:size}", jsContext.productSize),
    URL: window.location.href,
    Brand: jsContext.productInfo.brand ? (jsContext.productInfo.brand.name ? jsContext.productInfo.brand.name : '') : ''     
};

// Output to console in Retention debugger mode only
if (window.location.href.includes('vge=true')) {
    console.log("BigCommerce Data", jsContext);
    console.log("Payload for Reclaim events", vpitem);
}

// Call Retention Reclaim events once DOM is loaded 
document.addEventListener('DOMContentLoaded', function () {
    // Call Product Viewed Reclaim event
    geq.event('Viewed Product Reclaim', vpitem);

    // The following code works for ATC when the page is not redirected
    (function() {
  var originalXHROpen = window.XMLHttpRequest.prototype.open;
  window.XMLHttpRequest.prototype.open = function(method, url, async, user, password) {
    originalXHROpen.apply(this, arguments);
    if (url.includes('/cart/add')) {
      this.addEventListener('load', function() {
        if (this.readyState === 4 && this.status === 200) {
          try {
            var item_info = JSON.parse(this.response);
            if (item_info && item_info.data && item_info.data.line_items && item_info.data.line_items.length > 0) {
              var line_item = item_info.data.line_items[0];
              var itemAdded = {
                Name: line_item.product_name,
                Price: item_info.data.product_value,
                ProductID: line_item.product_id,
                Categories: line_item.category_names && line_item.category_names.length > 0 ? line_item.category_names[line_item.category_names.length - 1] : '',
                ImageURL: item_info.data.cart_item.thumbnail,
                URL: item_info.data.cart_item.url,
                Brand: line_item.brand_name || ''
              };
              console.log(itemAdded);
              if (typeof geq !== 'undefined' && geq.addToCart) {
                geq.addToCart(itemAdded);
              }
            }
          } catch (error) {
           if (window.location.search.includes('vge=true')) {
              console.error('Error processing XMLHttpRequest response:', error);
            }
          }
        }
      });
    }
  };
})();
    
});
</script>
Where to add the code?

Code Snippet 1: Insert the initial code block into the product-view.html file, following steps 1 to 3 outlined below. Subsequently, place the second code block within Templates -> Pages -> Cart.html.

Code Snippet 2: Insert the code block into the product-view.html file, following steps 1 to 3 outlined below.


Adding script to BigCommerce

1. In your BigCommerce storefront, go to Themes > Click the "Advanced" dropdown on the current theme > Click "Edit Theme Files"

2. Once you have access to your theme files, proceed to Templates > Components > Products

3. In the "products" folder, locate and open the "product-view.html" file. Copy the provided code block from above and paste it into the editor. Save the changes by clicking the button positioned at the bottom right corner of the screen.

4. Verify the functionality of the code by navigating to a product page and activating the Retention debugger. Confirm that the "Viewed Product Reclaim" event is detected and triggered. Additionally, ensure that the "Add to Cart" event is identified, and it should be activated upon adding the product to your cart.

Disclaimer

General:

These scripts attempt to utilize the capabilities offered by BigCommerce and are intended to be lightweight and perform well in the majority of scenarios. We understand that every website is unique and as such, variations may be required by your team.

To automatically remove California Consumer Privacy Act (CCPA) opt-outs that were completed on your website from our database, you will need to install the CCPA opt-out script:

geq.optevent()

Add this script to fire on your CCPA opt-out page, and update 'email-address' and 'EmailFormID' in the script below to match the variable for email address and the class name for your specific form submission button:

<script type="text/javascript">
        var gesubmitaction = function () {geq.optevent(document.getElementById('email-address').value)};
        var s_classname = document.getElementsByClassName("EmailFormID");
        for (let i = 0; i < s_classname.length; i++) {
            s_classname[i].addEventListener('submit', gesubmitaction);
        }
</script>

You can also add 'geq.optevent()' directly to the submit button.

Have questions? Message us on chat, or email support[at]retention.com!

In this video, we'll share where to find your Retention.com snippet script code and how to add it to your GrooveFunnels site.

Where to find your Retention.com snippet script

1. From your Retention.com Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add collection snippet script to page

1. From your GrooveFunnels' dashboard, click GroovePages under GrooveFunnels.

2. Click the site you want to add the collection snippet script to.

3. Choose which page you want the snippet script to be on (ex. Home) from the top drop-down menu. Or, you can choose between Pages in the left-hand navigation. Then, click Elements in the left-hand navigation. Next, click and drag Code Embed onto the page.

4. Click the Embed your code here box. Then, click the gear that appears on the left. (This code box will not be visible to visitors.)

5. Paste your Retention.com collection snippet script into the Edit source code box, and click Save.

6. You'll be taken back to the editor page. Remember to hit Save at the top right when you're finished.

7. From your Retention.com dashboard, click On next to Script Status to turn your script on.

How to add collection snippet script to entire site

1. To add your Retention.com collection script to your entire site, click the three lines in the top right of your editor page, and then click Site settings.

2. Paste your collection script into either the top or bottom boxes. Then, click the checkmark to save your changes.

3. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to add suppression script

The suppression script can be added to your website on any pages that you do NOT want Retention.com to collect email addresses. Generally speaking, you would put this script on landing pages where the person has already converted, and therefore, you have already collected their email address.

Examples of pages you’d want to add the suppression script to are post-checkout, thank you, and confirmation pages.

1. From your GrooveFunnels' dashboard, click GroovePages under GrooveFunnels.

2. Click the site you want to add the suppression snippet script to.

3. Choose which page you want the snippet script to be on from the top drop-down menu. Then, click Elements on the left-hand navigation. Next, click and drag Code Embed onto the page.

4. Click the Embed your code here box. Then, click the gear that appears on the left. (This box will not be visible to visitors.)

5. Paste your Retention.com suppression snippet script into the Edit source code box, and click Save.

6. Remember to hit Save at the top right of the editor page when you're finished.

7. From your Retention.com dashboard, click On next to Script Status to turn your script on.  You will have access to this once you collect onboarding.

How to setup collection rules

You can setup rules that are used to automatically trigger a collection event based on the number of page views and/or seconds on a page. This allows you to collect higher-level contacts.

1. To setup the rules, click Code Script in the left-hand navigation and then click the edit icon next to Collection Rules.

2. Toggle to Yes to Auto collect the contact after X page views, and type the number of Page Views in the box. For example, if you want a visitor to have 2 page views before the collection script is triggered, type ‘2’ in the box.

Toggle to Yes to Auto collect the contact after X seconds on a single page, and type the number of Seconds in the box. For example, if you want the collection script to wait 10 seconds before it fires, type ’10’ in the box.

3. When you’re finished, click Save Changes.

How to test your script to confirm it's working

Click here to learn how to test your script.

At Retention.com, we approach every interface with the idea of making it as clean and simple as possible, and our APIs are no different. One of the keys to Retention.com success is listening to its users and incorporating their feedback. For help with the API, please email support[at]retention[dot]com.


Click here for Retention.com API Docs

 

Getting Started:

1. You can create and find your API ID and Key under My Account > API Details in your Retention.com account.

2. If you don't currently have an API Key and API ID created, click New Credentials.

3. In the pop-up box, enter a Name and Description for your API Credentials. Click Create. (You can change these later.)

4. Your API Key and API ID will appear. Click the Copy icons.

 

 


Click here for Retention.com API Docs

In this video, we'll show you where to find your Retention.com snippet script code and how to add it to your Squarespace site.

Where to find your Retention.com snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>.

How to add collection snippet script

1. Log in to your Squarespace account.

2. Click Settings on the left-hand side.

Squarespace Settings

3. Scroll down, and click Advanced.

4. Click Code Injection.

5. Paste the HTML code copied from Retention.com into the Header or Lock Page box. Click Save.

4. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

To inject code into a specific page

1. Log into your Squarespace account.

2. Click Pages.

Squarespace Pages

3. Hover your cursor over the page where you want to add the code. Click the Settings icon.

4. A box will appear. Click Advanced and then Page Header Code Injection.

Squarespace Advanced Header

5. Paste the HTML code copied from Retention.com into the Page Header Code Injection box. Click Save.

Note: Code injection is a premium feature only available on Squarespace's Business or Commerce plans.

6. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to add suppression script

The suppression script can be added to your website on any pages that you do NOT want Retention.com to collect email addresses. Generally speaking, you would put this script on landing pages where the person has already converted, and therefore, you have already collected their email address.

Examples of pages you’d want to add the suppression script to are post-checkout, thank you, and confirmation pages.

1. From your Retention.com Dashboard, click Code Snippet in the left navigation and then </> View Script. Then, check the box next to Suppression, and click Copy Code.

2. Follow the steps above to inject the code into a specific page (ex. post-checkout, thank you, and confirmation pages). You would choose one of those pages in Step 3 shown above and continue to Step 5.

3. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to setup collection rules

You can setup rules that are used to automatically trigger a collection event based on the number of page views and/or seconds on a page. This allows you to collect higher-level contacts.

1. To setup the rules, click Code Script in the left-hand navigation and then click the edit icon next to Collection Rules.

2. Toggle to Yes to Auto collect the contact after X page views, and type the number of Page Views in the box. For example, if you want a visitor to have 2 page views before the collection script is triggered, type ‘2’ in the box.

Toggle to Yes to Auto collect the contact after X seconds on a single page, and type the number of Seconds in the box. For example, if you want the collection script to wait 10 seconds before it fires, type ’10’ in the box.

3. When you’re finished, click Save Changes.

How to test your script to confirm it's working

Click here to learn how to test your script.

In this video, we'll share where to find your Retention.com snippet script code and how to add it to your ClickFunnels site.

Where to find your Retention.com collection snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes.

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add collection snippet script to entire funnel

1. Visit your ClickFunnels dashboard. Hold your cursor over Click Funnels and then click Funnels from the drop-down menu.

2. Choose one of your funnels from the list, and click the funnel title.

3. Click Settings.

4. Paste your script into the Head Tracking Code box.

5. Scroll down to the bottom, and click Save And Update Settings.

6. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to add suppression script

The suppression script can be added to your website on any pages that you do NOT want Retention.com to collect email addresses. Generally speaking, you would put this script on landing pages where the person has already converted, and therefore, you have already collected their email address.

Examples of pages you’d want to add the suppression script to are post-checkout, thank you, and confirmation pages.

1. From your Retention.com Dashboard, click Code Snippet in the left navigation and then View Script. Then, check the box next to Suppression, and click Copy Code.

2. Visit your ClickFunnels dashboard. Hold your cursor over Click Funnels and then click Funnels from the drop-down menu.

3. Choose one of your funnels from the list, and click the funnel title.

4. Under the page you want to add the suppression script to (ex. post-checkout, thank you, or confirmation page), click Edit Page.

5. Click Settings > Tracking Code from the top left.

6. Paste your Retention.com suppression script into the Header Code box. Then, click Save in the top right.

7. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to setup collection rules

You can setup rules that are used to automatically trigger a collection event based on the number of page views and/or seconds on a page. This allows you to collect higher-level contacts.

1. To setup the rules, click Code Script in the left-hand navigation and then click the edit icon next to Collection Rules.

2. Toggle to Yes to Auto collect the contact after X page views, and type the number of Page Views in the box. For example, if you want a visitor to have 2 page views before the collection script is triggered, type ‘2’ in the box.

Toggle to Yes to Auto collect the contact after X seconds on a single page, and type the number of Seconds in the box. For example, if you want the collection script to wait 10 seconds before it fires, type ’10’ in the box.

3. When you’re finished, click Save Changes.

How to test your script to confirm it's working

Click here to learn how to test your script.

This guide is here to help you quickly set up and use Retention's collection, suppression, and revenue tracking scripts, all integral parts of "Grow".

Click here for a link to the tutorial on how to add Reclaim events to your site.

In this video, we'll show you where to find your Retention.com collection script and how to add it to your BigCommerce store.

Where to find your Retention.com collection snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes.

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add Collection script

1. Log in to your BigCommerce account. From the left navigation, click Storefront.

2. Click Script Manager from the left navigation and then click Create a Script.

3. Name your script, give it a Description (optional), select Header for the placement, select Storefront pages for the location, choose Script under Script type, and paste your Retention.com script in the Script contents box. Click Save.

How to add Suppression script

The suppression script can be added to your website on any pages that you do NOT want Retention.com to collect email addresses. Generally speaking, you would put this script on landing pages where the person has already converted, and therefore, you have already collected their email address.

Examples of pages you’d want to add the suppression script to are post-checkout, thank you, and confirmation pages.

1. From your Retention.com Dashboard, click Code Snippet in the left navigation and then View Script. Then, check the box next to Suppression, and click Copy Code.

2. Log in to your BigCommerce account. From the left navigation, click Storefront. Then, Click Script Manager, and click Create a Script.

3. Name your script, give it a Description (optional), select Header for the placement, choose to place it on the Order confirmation page, check the Script box, and then paste your Retention.com suppression script into the Script contents box. Click Save.

4. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

Click here to learn how to test your script.

How to add Revenue Tracking script

You can use your Retention.com's revenue tracking script to capture order information for your Retention.com contacts that land on your BigCommerce page. Tracking codes typically are used on the order status page. Once data is collected, your dashboard will display your week-over-week ROI from your Retention.com contacts.

Here's how to add your Retention.com revenue tracking script to your BigCommerce site.

What you'll need

1. You'll need to copy your revenue tracking script from Retention.com. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Revenue Tracking, and click Copy Code.

Adding Tracking to BigCommerce

1. From your BigCommerce dashboard, click Settings > Advanced > Data Solutions. 

Click the "Connect" button next to Affiliate Conversion Tracking.

2. Paste your Retention.com revenue tracking script into the Conversion Tracking Code box.

3. You will need to replace ORDER_NUMBER, DOLLAR VALUE, and ORDER EMAIL in the code with BigCommerce’s variables.

Click Connect when you’re finished.

4. You can then track your revenue, contacts, and ROI from your Retention.com dashboard.

Revenue Tracker

In this video, we’ll show you how where to find your Retention.com snippet script code and how to add it to your Wix site.

Where to find your Retention.com collection snippet script

1. From your Retention Dashboard, click Code Script.  Then, click View Your Script.

2. Check the box next to Collection, and then click Copy Code </>. You’ll see a green box in the top right-hand corner telling you the code was copied to your clipboard.

Copy Collection

Remember: You can’t check multiple boxes for scripts or you will get an error message. You can only copy one at a time.

3. Once you’ve added the script to your domain, go back to Code Script and click the edit icon next to Authorized Domains.

4. Paste the domain/URL in the text box where you added the script, and click Save Changes.

It will be highlighted in green if the script is properly installed—and in orange if the script is not properly added.

How to add collection snippet script

1. Log in to your Wix account.

2. Click Settings from the left-hand Dashboard.

3. Under Advanced Settings, click Tracking & Analytics.

4. Click New Tool > Custom.

5. Paste the collection snippet script code into Paste the code snippet here box. Click Apply.

6. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to add suppression script

1. Log in to your Wix account.

2. Click Settings from the left-hand Dashboard.

3. Under Advanced Settings, click Tracking & Analytics.

4. Click New Tool > Custom.

5. Paste the suppression snippet script code into Paste the code snippet here box. Then, click the Choose specific page bubble, and select the page where you want to add your suppression script. When you're finished, click Apply.

6. From your Retention.com dashboard, click On next to Script Status to turn your script on. You will have access to this once you collect onboarding.

How to setup collection rules

You can setup rules that are used to automatically trigger a collection event based on the number of page views and/or seconds on a page. This allows you to collect higher-level contacts.

1. To setup the rules, click Code Script in the left-hand navigation and then click the edit icon next to Collection Rules.

2. Toggle to Yes to Auto collect the contact after X page views, and type the number of Page Views in the box. For example, if you want a visitor to have 2 page views before the collection script is triggered, type ‘2’ in the box.

Toggle to Yes to Auto collect the contact after X seconds on a single page, and type the number of Seconds in the box. For example, if you want the collection script to wait 10 seconds before it fires, type ’10’ in the box.

3. When you’re finished, click Save Changes.

How to test your script to confirm it's working

Click here to learn how to test your script.

If you use Klaviyo popups or forms, you can prevent collection of contacts who opt in via your popup or form. This can be done using Klaviyo's Event Listener.

General Structure of the klaviyoForms Event

Klaviyo forms send an event called klaviyoForms to the window each time a form is shown, closed, or submitted. You add one listener to your page for all Klaviyo form events. Below is the structure of the Klaviyo form event:

<script>
  window.addEventListener("klaviyoForms", function (e) {
    if (e.detail.type == "submit") {
      geq.suppress();
    }
  });
</script>

So the full script would look like this (NOTE this is not a script you can use/copy because the collection script is not specific to your account):

<script type="text/javascript">
  !(function () {
    var geq = (window.geq = window.geq || []);
    if (geq.initialize) return;
    if (geq.invoked) {
      if (window.console && console.error) {
        console.error("GetEmails snippet included twice.");
      }
      return;
    }
    geq.invoked = true;
    geq.methods = ["page", "suppress", "trackOrder", "identify", "addToCart"];
    geq.factory = function (method) {
      return function () {
        var args = Array.prototype.slice.call(arguments);
        args.unshift(method);
        geq.push(args);
        return geq;
      };
    };
    for (var i = 0; i < geq.methods.length; i++) {
      var key = geq.methods[i];
      geq[key] = geq.factory(key);
    }
    geq.load = function (key) {
      var script = document.createElement("script");
      script.type = "text/javascript";
      script.async = true;
      script.src = "https://s3-us-west-2.amazonaws.com/storejs/a/" + key + "/ge.js";
      var first = document.getElementsByTagName("script")[0];
      first.parentNode.insertBefore(script, first);
    };
    geq.SNIPPET_VERSION = "1.5.0";
    geq.load("XXXXXXX");
  })();
</script>
<script>
  geq.page();
</script>
<script>
  window.addEventListener("klaviyoForms", function (e) {
    if (e.detail.type == "submit") {
      geq.suppress();
    }
  });
</script>

More details on adding Custom JavaScript Events to Forms can be found here.