• Resolved marujobhz

    (@marujobhz)


    hi,
    the client manage the social ads for site that i create in wordpress.
    he wants to insert gtag for get whats app clicks.
    he send me this instruction bellow:

    i already put on head section, but he told me that need to insert directly on button.
    how i can do it, on whatsapp in microwidgets?

    Copie o snippet abaixo e cole-o entre as tags <head></head> das páginas que você quer acompanhar, logo após a tag global do site. Em seguida, chame gtag_report_conversion quando alguém clica no link ou bot?o escolhido.

    <!– Event snippet for Convers?o NAME OF THE SITE conversion page
    In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. –>
    <script>
    function gtag_report_conversion(url) {
    var callback = function () {
    if (typeof(url) != 'undefined') {
    window.location = url;
    }
    };
    gtag('event', 'conversion', {
    'send_to': 'AW-XXXXXXXXXXXXXXXXXXXXXXXXX',
    'value': 1.0,
    'currency': 'BRL',
    'event_callback': callback
    });
    return false;
    }
    </script>

    how i must configure this inside button of Whatsapp join chat?
    tks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Creame

    (@creapuntome)

    Hi, you can call your conversion function on the event joinchat:open.

    e.g.: adding this code in your footer before the </body> tag.

    <script>jQuery(function($){ $(document).on('joinchat:open', function(){ gtag_report_conversion(); }); });</script>

    Thread Starter marujobhz

    (@marujobhz)

    hi. thanks a lot. i will test it and returns to you.

    • This reply was modified 3 years, 12 months ago by marujobhz.
    Plugin Contributor davidlillo

    (@davidlillo)

    We closed this ticket. ??

    Thread Starter marujobhz

    (@marujobhz)

    Hi, the function in example of @creapuntome works correctly!! Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Gtag event on WhatsApp button’ is closed to new replies.