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.
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 the Retention Base Script & Grow 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.
How to add the Grow Revenue Tracking Script
The Grow Revenue Tracking script captures order data from the order confirmation page to provide insights into revenue generated by Grow contacts, which is then displayed in your Retention.com dashboard.
1. From your Retention Dashboard, click Code Script. Then, click View Your Script.
2. Check the box next to Revenue Tracking, and copy the second script tag - it is highlighted in orange below.
Pleas ensure you copy the <script></script> tags along with the highlighted portion.
3. Navigate to your Funnels page and click on your Order Confirmation/Thank You page from the navigation menu on the left.
Then click on "Edit Page".
4. 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 "Body HTML" tab. Copy and paste the Revenue tracking code snippet from the Retention dashboard into the code area.
You are required to update the script with the correct order data.
Our script requires dynamic variables for:
- Order Number
- Order Email
- Order Amount
Below you can find an example using variables from Funnelish. Please ensure these variables are available by contacting the Funnelish support team.
<script>
const ORDER_EMAIL = localStorage.getItem('fnsh.core.customer.email') || '';
const ORDER_VALUE = funnelish.getCookie("funnelish_order_value") || '';
const urlParams = new URLSearchParams(window.location.search);
const ORDER_NUMBER = urlParams.get('activityId') || new Date().getTime();
geq.trackOrder({order_number: ORDER_NUMBER, order_amount: ORDER_VALUE, order_email: ORDER_EMAIL});
</script>
Once the script is updated, click "Save Changes".
4. Close the Custom Code window and save your changes by clicking the button on the top right of the screen.
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*:
Name of Product
Price
ProductID
Categories (if applicable)
ImageURL
Brand (if applicable)
*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 buttons on your page. i.e. a[href="#next-step"]
var addToCartButtons = document.querySelectorAll('a[href="#next-step"]');
addToCartButtons.forEach(function(button) {
button.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.