PD/ONE: Bigcommerce Integration Instructions

Use these instructions as a starting point for integrating PD/ONE Features into your Bigcommerce "Stencil" store. (Minor modifications will be needed for installation on a Bigcommerce store using (legacy) "Blueprint" templates.)

Step 1: Add the "PD Tagging Code" to your base.html template

(Usually located under "Storefront Design: My Themes: Current Theme: Advanced: Edit Theme Files: Templates: Layout: base.html")

Near the top of the page template (after the opening body tag), add the following code:
<!-- ************************************** -->
<!-- ********* START PD TAGGING *********** -->
<!-- ************************************** -->
<div id="pdPageTag" style="display:none" productId="{{product.id}}" productCode="{{product.sku}}" categoryId="{{category.id}}"></div>
<!-- *************************************** -->
<!-- ********* FINISH PD TAGGING *********** -->
<!-- *************************************** -->


Step 2: Add the "PD Integration Script" to your Footer Script

(Located under "Storefront Design: Scripts: Footer")

<!-- ************************************************* -->
<!-- ********* START PD INTEGRATION SCRIPT *********** -->
<!-- ************************************************* -->
<script type="text/javascript">
function pdInit() {

    var elements = new Array();
    try {elements = document.getElementsByClassName("pdRatingStarCategory");} catch(e){}
    var productIdList = new Array();
    for(var i=0;i<elements.length;i++) {
        productIdList[i] = elements[i].getAttribute("productid");
    }

    var productIdListCsv = productIdList.join(",");

    var cb = (new Date()).getTime();
    var scriptUrl = https://XXXXXXXXXXXXXX.practicaldatacore.com/mod_bigcommerce/services/pageScript.php ;
    scriptUrl += ?cb= + cb;
    scriptUrl += &customerId= + encodeURIComponent("{{ customer.id }}");
    scriptUrl += &email= + encodeURIComponent("{{ customer.email }}");
    scriptUrl += &productId= + encodeURIComponent(document.getElementById("pdPageTag").getAttribute("productId"));
    scriptUrl += &productCode= + encodeURIComponent(document.getElementById("pdPageTag").getAttribute("productCode"));
    scriptUrl += &categoryId= + encodeURIComponent(document.getElementById("pdPageTag").getAttribute("categoryId"));
    scriptUrl += &productIdListCsv= + encodeURIComponent(productIdListCsv);

    var scriptElement=document.createElement('script');
    scriptElement.setAttribute("type","text/javascript");
    scriptElement.setAttribute("async","async");
    scriptElement.setAttribute("src", scriptUrl);
    document.body.appendChild(scriptElement);
}
pdInit();
</script>
<!-- ************************************************** -->
<!-- ********* FINISH PD INTEGRATION SCRIPT *********** -->
<!-- ************************************************** -->

* Note that the https://XXXXXXXXXXXXX.practicaldatacore.com/ in the code above should be replaced by your store-specific PD integration URL.


Step 3: PD/ONE Product Reviews Integration

If you are installing PD/ONE Product Reviews, follow the instructions here to set up page tagging on all your Bigcommerce pages:

https://www.practicaldata.com/bigcommerce-product-review-instructions.html

1,000+ Merchants Served Since 2002
Connect
Receive our lastest offers, tips and updates in your email!
Want to learn more?
Schedule an informative online demo to give us a test drive.
2022 Practical Data, Inc. Privacy Policy Terms of Service