Setting goals in Yandex Metrika on WordPress - 31
  • RU
  • Setting goals in Yandex Metrika on WordPress

    No marketer can call himself a professional if he didn’t set goals on the site right after its creation. What’s the reason to make a site if you don’t monitor its performance, after all?

    Our advice will be useful for those who have a site powered by WordPress and contact forms working on Contact Form 7 plugin.

    1. Open the list of your contact forms

    2. Create goals of JavaScript event in Yandex.Metrica

    You can set as many goals on your site as you want. But experience shows that you should go easy on them. It’s like juggle balls – if there are more than two or three, it’s hard to keep them under control.

    However, if a goal is of a certain weight, i.e. value, you can make plenty of them – the most significant thing here is just to keep them peer-to-peer. After that, you can make a segment in Yandex.Metrica reports to track traffic & ads results.

    3. Create and copy the event code to footer.php file inside the body tag.

    contactFormId — an id of a contact form, locates in the shortcode of each contact form
    yaCounter — a counter number of the metric
    contact_form_5852 — identifier of JavaScript goal you set in Yandex.Metrica

    <script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
     if(event.detail.contactFormId=="5852"){ 
     yaCounter49682755.reachGoal('contact_form_5852');
     }
     if(event.detail.contactFormId=="5971"){ 
     yaCounter49682755.reachGoal('contact_form_5971');
     }
     if(event.detail.contactFormId=="5981"){ 
     yaCounter49682755.reachGoal('contact_form_5981');
     }
     if(event.detail.contactFormId=="5860"){ 
     yaCounter49682755.reachGoal('contact_form_5860');
     }
     if(event.detail.contactFormId=="5970"){ 
     yaCounter49682755.reachGoal('contact_form_5970');
     }
     if(event.detail.contactFormId=="5982"){ 
     yaCounter49682755.reachGoal('contact_form_5982');
     }
    }, false );
    </script>
    Other blog
    posts
    Worsening A/B tests
    Typical task "do something better than it is now is". But you can do worse at any time. New way to test hypotheses in our article
    Read more
    SSL-сertificate setup
    HTTPS - has been a standard for a long time. We install the certificate immediately after purchasing the domain. Why is it important? Read our blog.
    Read more
    Worsening A/B tests
    Typical task "do something better than it is now is". But you can do worse at any time. New way to test hypotheses in our article
    Read more
    SSL-сertificate setup
    HTTPS - has been a standard for a long time. We install the certificate immediately after purchasing the domain. Why is it important? Read our blog.
    Read more
    Omsk, Russia
    Office 703, Gagarin St., 14
    mail@weare31.com
    In homage to Kandinsky
    Contacts
    +7(950)95-33-111
    mail@weare31.com
    Office 703, Gagarin St., 14, Omsk, Russia
    In homage to Kandinsky