F
F
ftomovden2016-07-26 15:01:24
Google
ftomovden, 2016-07-26 15:01:24

How to add conversion code to buttons in Woocommerce?

Good afternoon everyone.
Faced the following problem.
There is a site on woocommerce. Add GTM tags to the "Add to Cart", "Checkout" and "Confirm Order" buttons.
The tags look like this:
1. In the product card, to the "Add to cart" button, add the code
onclick="ga('send', 'event', 'zakaz', 'knopka_vkorzinu');
2. In the right pull-out window, to the button " Checkout" add code
onclick="ga('send', 'event', 'zakaz', 'knopka_oformlenie'); 3. In the shopping cart add the code onclick="ga('send', 'event', 'zakaz', 'knopka_podtverdit');
to the button "Confirm order" ; The question is the following.
I understand that this code can only be used on html examples and it will not work for woocommerce.
I searched all over the Internet, but I did not find the answer. All hope is on you! Thanks

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
unionfourman, 2016-08-21
@unionfourman

1. /woocommerce/single-product/add-to-cart and in general go through all the files
2. /woocommerce/cart mini-cart.php at the bottom
3. /woocommerce/cart proceed-to-checkout-button.php
and on jquery didn't write at all?

I
Igor, 2017-09-12
@mrTempl

How to write in google analytic with regular expressions, part of the url is contained in the address bar?
*/cart/*
*/checkout/*
*/order-received/*
and create both goal and funnel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question