Answer the question
In order to leave comments, you need to log in
How to target a metric on a button (add to cart, then at checkout) in Drupal Commerce?
It turned out to put the target on the button ADD TO CART as follows (in the template.php of the theme):
function bantiki_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
$incart="yaCounterXXXXXX.reachGoal('INCART'); return true;";
$form['submit']['#attributes']['onclick'] = $incart;
}
But in the page code instead of single quotes it is displayed:
onclick="yaCounterXXXXXX.reachGoal('INCART'); return true;"
How can this be fixed? And for the NEXT button when placing an order, it is impossible to display the goal in this way.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question