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.
- The topic ‘woocommerce google analytics integration’ is closed to new replies.