fanplayr
BigCommerce Integration

Updated a year ago

Integrating Fanplayr into BigCommerce

The integration of Fanplayr into your BigCommerce store is straightforward. It involves inserting JavaScript code similar to many other services such as Google Analytics. The scripts are used to track, capture and analyze user behavior, as well as monitor and analyze conversions.

All information is sent over SSL (secure HTTPS connection) to the Fanplayr servers.

To add these scripts you will need access to your BigCommerce administration console, including access to your conversion scripts and template files.

Note: In some scripts you will need to replace text that is highlighted.

You may also have to change the currency from “USD” to the currency your store uses if not “USD”. The three character ISO currency code (http://en.wikipedia.org/wiki/ISO_4217) for your chosen currency should be used.

Also note that your template needs to include jQuery (many already do) for the best tracking.

Track Conversions

The following script should be inserted into your conversion tracking code box. This can be found by going to Settings -> Conversions (top right).

Settings -> Conversions in your administration console

Now simply paste the following code into the box, change ACCOUNT_KEY in the highlighted line and click Save.

<!--FANPLAYR-->
<script>
var fanplayrAccountKey = 'ACCOUNT_KEY';
window.fanplayrGetCookie=function(a){var b=document.cookie,c=b.indexOf(" fanplayr_"+a+"=");if(-1==c&&(c=b.indexOf("fanplayr_"+a+"=")),-1==c)b=null;else{c=b.indexOf("=",c)+1;var d=b.indexOf(";",c);-1==d&&(d=b.length),b=unescape(b.substring(c,d))}return b};
// order total: %%ORDER_AMOUNT%%
(function(d, w, s) {
  if ( !w.fp_sales_orders ) {
    w.fp_sales_orders = {
      accountKey: fanplayrAccountKey ,
      data: {
        orderId: '%%ORDER_ID%%',
        orderNumber: '%%ORDER_ID%%',
        subTotal: %%ORDER_SUBTOTAL%%,
        total: %%ORDER_SUBTOTAL_DISCOUNTED%%,
        discount: %%ORDER_SUBTOTAL%% - %%ORDER_SUBTOTAL_DISCOUNTED%%,
        discountCode: fanplayrGetCookie('couponCode') || '',
        currency: 'USD',
        orderEmail: '%%ORDER_EMAIL%%',
        firstName: fanplayrGetCookie('firstName') || '',
        lastName: fanplayrGetCookie('lastName') || '',
        customerEmail: fanplayrGetCookie('customerEmail') || '',
        customerId: '',
        shipping: 0,
        tax: 0,
        shopType: 'custom',
        version: 3
      }
    };
    var js = d.createElement(s);
    var fjs = d.getElementsByTagName(s)[0];
    js.async = true;
    js.src = 'https://d1q7pknmpq2wkm.cloudfront.net/js/my.fanplayr.com/fp_custom_orders.js?' + (new Date().getTime());
    fjs.parentNode.insertBefore(js, fjs);
  }
})(document, window, 'script');
</script>
<!--/FANPLAYR-->