fanplayr
Integrating Fanplayr into your Nexternal Store

Updated 7 months ago

Integrating Fanplayr with your Nexternal Store

The integration of Fanplayr into your Nexternal store is simple! Just follow these easy steps:

  1. Activate a Fanplayr account.
  2. Request the Account Key from your Fanplayr account representative.
  3. Log into your Nexternal account, and paste the code snippets in the appropriate fields (see below for details).

Once this is done this code snippet will be used by Fanplayr to track, capture and analyze user behavior, as well as monitor and analyze conversions. It will also allow the display of targeted offers to your users.

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

Note: Session Codes and Apply To Cart are not supported .

Adding Fanplayr

User tracking code must be inserted “Tracking Code” and “Order/Affiliate Addendum” settings. These can be found by going to Settings, then clicking “Edit” on Policies, Addend, and Disclaimers.

Click the “Settings” tab, then scroll down and click edit next to “Policies, Addenda, and Disclaimers”.

You will then find the text areas to insert the tracking code (following page). Please note that you will have to replace your account key, and domain in this code.

Tracking Codes (User Tracking)

The text between the < brackets > to be replaced with the values supplied by Fanplayr. The description for this text is below.

<script type="text/javascript">
(function(w,f,c){ w[f] = w[f] || {}; w[f][c] = w[f][c] || {};
  w[f][c].account_key = '< account_key >';
  w[f][c].store_domain = '< store_domain >';
}(window,'fanplayr','config'));
</script>
<script type="text/javascript" src="https://s3.amazonaws.com/fanplayr-assets/adaptors/nexternal/nexternal-user-tracking.min.js"></script>

account_key: The Account Key supplied by Fanplayr eg ‘9d91fc171c616ebf50c9808fa9d4c05a’;

store_domain: The main domain that your store runs on. If your Nexternal store was running on "http://store.maindomain.com" then your store domain would be "maindomain.com".

Tracking on pages that are not your Nexternal store

Many Nexternal sites would like to track users, and display our widget on pages that do not have the Nexternal cart visible. These pages may be on the main site eg. “www.maindomain.com” or on a sub-domain such as “videos.maindomain.com”.

To accomplish this you you will need to add the tracking code to your other pages (normally in an included header or footer) and add an extra variable as follows:

<script type="text/javascript">
(function(w,f,c){ w[f] = w[f] || {}; w[f][c] = w[f][c] || {};
  w[f][c].account_key = '< account_key >';
  w[f][c].store_domain = '< store_domain >';
  w[f][c].custom_apply_to_cart_url = '< store_page_url >';
}(window,'fanplayr','config'));
</script>
<script type="text/javascript" src="https://s3.amazonaws.com/fanplayr-assets/adaptors/nexternal/nexternal-user-tracking.min.js"></script>

store_page_url: Any page on your store that has a cart on it eg. "http://store.maindomain.com/product-list"

Order/Affiliate Addendum (Order Tracking)

Before adding the following code please make sure that the Encoding has been set to "JavaScript". The account_key and store_domain should be set same as above.


<script>
(function(d, w){

  w.fanplayr = w.fanplayr || {};
  w.fanplayr.config = w.fanplayr.config || {};

  // fanplayr staging
  w.fanplayr.config.account_key = '< account_key >';
  w.fanplayr.config.store_domain = '< store_domain >';

  // tracking variables from template
  var fd = {};

  fd.orderId = 'ORDER_NO';
  fd.orderNumber = 'ORDER_NO';
  fd.subTotal = ORDER_SUBTOTAL;
  fd.total = ORDER_NET;
  fd.discount = DISCOUNT_TOTAL;
  fd.orderEmail = "EMAIL";
  fd.firstName = "FIRST_NAME";
  fd.lastName = "LAST_NAME";
  fd.customerEmail = "EMAIL";
  fd.customerId = 'CUSTOMER_NO';
  fd.shipping = parseFloat(SHIPPING_TOTAL + '') || 0;
  fd.tax = parseFloat(SALES_TAX_TOTAL + '') || 0;

  var products = [];
  FOR_EACH_PRODUCT(
  products.push({
    id: 'PRODUCT_NO',
    qty: PRODUCT_QUANTITY,
    name: "PRODUCT_NAME",
    sku: "PRODUCT_SKU",
    catId: '',
    catName: "PRODUCT_CATEGORY",
    price: parseFloat(PRODUCT_PRICE + '') || 0
  });
  )
  fd.products = JSON.stringify(products);

  w.fanplayrData = fd;

  // add fanplayr script
  var x = d.getElementsByTagName('script')[0];
  var s = d.createElement('script');
  s.async = true;
  s.src = 'https://s3.amazonaws.com/fanplayr-assets/adaptors/nexternal/nexternal-order-tracking.min.js';
  x.parentNode.insertBefore(s, x);

}(document, window));
</script>