WordPress.org

Forums

WooCommerce - excelling eCommerce
woocommerce google analytics integration (1 post)

  1. jadamsso
    Member
    Posted 7 months ago #

    I have selected the option to generate a Google Analytics event when the Add to Card is selected. Except that the event label passed to the function is the product ID. The code is found in class-wc-google-analytics.php, and in particular in this line:

    $parameters['label'] = "'#' + $(this).attr('data-product_id')"; // Product ID

    I have two questions. First, is there a variable that I can use so that my product SKU is used instead of the product ID? Second, how can I override this function without directly editing the original file?

    Any help would be appreciated.

    http://wordpress.org/extend/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic