Skip to content

Instantly share code, notes, and snippets.

@prb
Last active August 29, 2015 13:57
Show Gist options
  • Save prb/9403633 to your computer and use it in GitHub Desktop.
Save prb/9403633 to your computer and use it in GitHub Desktop.
US Polo Association BEP Notes

BEP Integration Notes for US Polo Association

This note covers BEP integration for [http://www.uspoloassn.com/](US Polo Association).

Seller ID

Your seller IDs are:

Environment ID
Production a7S8p2Y5o8g5f5x6M5j3t7X5S1v0P4W5l0R0t7T6
Staging V0n8e4A1t0i2B1J1i0Q6c7a0P6I6p4C1h2w8u6j5

BEP Live and Staging Environments

There is a debug-enabled tracking script available at https://stage-chktrk.ifario.us/x/2/SELLER_ID. This script operates against the identical list of seller IDs but traffic does not contribute to reports and will (safely) log to the browser Javascript console as bindings occur and events are dispatched.

Integration Points

  • /cart
  • /checkout/payment
  • /checkout/review
  • The order confirmation or thank you page.
  • Every page, depending on the answer to the question below about the SHOPPING BAG flyover.

Quesions

  1. From the SHOPPING BAG flyover, clicking on the "Amazon" option takes the user to the cart review page, but clicking on the "PayPal" option takes the user straight to PayPal without setting shipping or other. Is this intended?
  2. The SHOPPING BAG flyover isn't part of the page at load time, making it difficult to hook the buttons therein.
<!--
For /cart
Same instrumentation applies to the shopping bag flyover/popup
-->
<script src="https://chktrk.ifario.us/x/2/SELLER_ID" type="text/javascript"></script>
<script type="text/javascript">
(function() {
window.jQuery('div.paypal-action img').each(function(i,v) { CheckoutTracker.bindAnchor(v,'P')});
window.jQuery('div.amazon-action img').each(function(i,v) { CheckoutTracker.bindAnchor(v,'A')});
window.jQuery('table.wl-totals-table tr.total td').contents().each(function(i,v) { CheckoutTracker.setAmount(v.data); });
CheckoutTracker.sendDisplay();
})();
</script>
<script src="https://chktrk.ifario.us/x/2/a7S8p2Y5o8g5f5x6M5j3t7X5S1v0P4W5l0R0t7T6" type="text/javascript"></script>
<script type="text/javascript">
(function() {
var baseline = { 'paypal':'P', 'amazon':'A', 'new_card':'N' };
window.jQuery('input[id*="payment_"]').each(function(i,v) {
if (v.value && v.value.match(/^[0-9a-fA-F]{10,}$/)) { baseline[v.value]='N'; }
});
window.jQuery('button.wl-button:contains("Continue")').each(function(i,v) {
CheckoutTracker.bindFormValue(document.forms.checkout_form, 'payment', baseline, v);
});
})();
<script src="https://chktrk.ifario.us/x/2/a7S8p2Y5o8g5f5x6M5j3t7X5S1v0P4W5l0R0t7T6" type="text/javascript"></script>
<script type="text/javascript">
(function() {
window.jQuery('table.wl-totals-table tr.total td').contents().each(function(i,v) { CheckoutTracker.setAmount(v.data); });
CheckoutTracker.sendDisplay();
})();
<script src="https://chktrk.ifario.us/x/2/a7S8p2Y5o8g5f5x6M5j3t7X5S1v0P4W5l0R0t7T6" type="text/javascript"></script>
<script type="text/javascript">
(function() {
CheckoutTracker.sendPurchased();
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment