AddShoppers Help Desk

Support Center

[WooCommerce] Installation Instructions

Last Updated: Feb 09, 2016 11:50AM EST

The easiest way to get up and running with AddShoppers on WooCommerce is through our WordPress Plugin (instructions for that here). 

The instructions below are for manual installation if you can't use the plugin for some reason, or if you want to use non-default sharing buttons (see the Sharing Buttons Installation section).

Influencer Analytics Installation

Copy and paste this code into your functions.php file. Then, copy your Influencer Analytics code and replace the part in bold with the Influencer Analytics code.

// AddShoppers Social Analytics Code
function addshoppers_social_analytics() {
    ?>
    Copy and paste your AddShoppers Social Analytics code here.
    <?php
}
add_action('wp_footer', 'addshoppers_social_analytics');

ROI Tracking Installation

Copy and paste this code into your functions.php file. Then, copy your ROI Tracking code and replace the part in bold with the ROI Tracking code.

// AddShoppers ROI Tracking Code
add_action( 'woocommerce_thankyou', 'addshoppers_roi_tracking' );
function addshoppers_roi_tracking( $order_id ) {
   $order = new WC_Order( $order_id );
 ?>
Copy and paste your AddShoppers ROI Tracking code here.
<?php
}

If you are using a more recent version of WooCommerce please use the following code instead being sure to replace the bolded text with your Site ID:

<?php
 add_action( 'woocommerce_thankyou', 'addshoppers_roi_tracking_manual' );
function addshoppers_roi_tracking_manual($order_id) {
    $order = new WC_Order( $order_id );
?>
    <script type="text/javascript">
    AddShoppersConversion = {
    order_id: <?php echo $order_id; ?>,
    value: <?php echo $order->get_total(); ?>
    };
    var js = document.createElement('script'); js.type = 'text/javascript'; js.async = true; js.id = 'AddShoppers';
    js.src = ('https:' == document.location.protocol ? 'https://shop.pe/widget/' : 'http://cdn.shop.pe/widget/') + 'widget_async.js#Copy and paste your Site ID here';
    document.getElementsByTagName("head")[0].appendChild(js);
    </script>
    <?php
}
?>

Sharing Buttons Installation

Copy and paste this code into your functions.php file. Then, copy your Sharing Button code and replace the part in bold with the Sharing Button code.

Please note that you can change the hook to place your buttons in a different location on the product page. It's "woocommerce_single_product_summary" here, but you might want to change it. You can see a list of all WooCommerce hooks here.

// AddShoppers Sharing Buttons Code
add_action( 'woocommerce_single_product_summary', 'addshoppers_button_code', 20 );
function addshoppers_button_code() {
   ?>
      Copy and paste your AddShoppers Sharing Button Code here
   <?php     
}

Contact Us

  • Please use the floating chat bubble in the bottom right hand side of your screen to initiate a request.

http://assets2.desk.com/
false
addshoppers
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete