Volusion

A guide to installing Friendbuy on your Volusion store

Samantha avatar
Written by Samantha
Updated over a week ago

⚠️ To complete this process, you must have access to your website source code and be relatively comfortable with HTML (or have a developer that can help you).

Install the SmartPixel

Inside your Friendbuy account, locate your Friendbuy site ID.  It will be included in your SmartPixel code here.  In the example below, the site ID is site-1234-sampledomain.com.

window['friendbuy'].push(['site', 'site-1234-sampledomain.com']);

Save your site ID somewhere close - you'll need it soon enough!

In your Volusion admin panel, click on "Design" on the top menu bar:

Click on "Edit HTML" under "Advanced Editing".  In the <head> tag, paste the following SmartPixel code.  

⚠️ The code below is customized for Volusion - all you'll need to do is replace "xxxxx" with your site ID from earlier:

  <!-- Start Friendbuy -->
<script>
window['friendbuy'] = window['friendbuy'] || [];
window['friendbuy'].push(['site', 'xxxxx']);
$.ajax({
    url: "/api/v1/users/current",
    dataType: "json",
    complete: function(res, status) {
        try {
            if (status !== 'success') {
                return false;
            }
            user = res.data;
            if (user.isAnonymous) {
                return false;
            }
            window['friendbuy'].push(['track', 'customer', {
                id: user.id,
                email: user.email
            }]);
            return true;
        } catch (e) {
            return false;
        }
    }
});
(function (f, r, n, d, b, y) {
    b = f.createElement(r), y = f.getElementsByTagName(r)[0];b.async = 1;b.src = n;y.parentNode.insertBefore(b, y);
})(document, 'script', '//djnf6e5yyirys.cloudfront.net/js/friendbuy.min.js');
</script>
<!-- End Friendbuy -->

Install Conversion Tracker

In Volusion, navigate to Design > Site Content > Article ID 130.  From there, click the "HTML" button next to the article body:

Paste and save the following conversion tracker code in the article body:

<!-- Start Friendbuy Conversion Tracker -->
<script>
    window['friendbuy'] = window['friendbuy'] || [];
    window['friendbuy'].push(['track', 'order', {
        id: Order[0],
        amount: Order[2],
        email: Order[9]
    }]);
    var products = [];
    for (var i = 0; i < OrderDetails.length; i++) {
        products.push({
            sku: OrderDetails[i][2],
            price: OrderDetails[i][5],
            quantity: OrderDetails[i][6]
        });
    }
    window['friendbuy'].push(['track', 'products', products]);
</script>
<!-- End Friendbuy Purchase Tracker -->

Next Steps

With your SmartPixel and conversion tracker installed, you're free to configure and install your widgets before launching your referral program.

Did this answer your question?