Viewing 15 replies - 1 through 15 (of 19 total)
  • Thread Starter aliputin

    (@aliputin)

    I would like to know where users come from to my website: from offline marketing papers whith qr codes on them or from scanning a qr code on my website pages by a smartphone.

    Plugin Author Bappa Mal

    (@bappa1995)

    Hello @aliputin,

    Thanks a lot for reaching out us. You can add UTM parameters to product permalink using wcqrc_product_permalink filter.

    For reference use bellow code snippet in themes function.php file.

    add_filter('wcqrc_product_permalink', 'wcqrc_product_permalink', 10, 2);
    function wcqrc_product_permalink($permalink, $product_id){
        return $permalink . $utm_parameters; //where $utm_parameters is your product UTM parameters
    }  

    For any further query / assistance please get in touch with us through [email protected]

    Thanks and Regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    Thank you.
    And can you explain in detail how to do that and use wcqrc_product_permalink filter?

    Plugin Author Bappa Mal

    (@bappa1995)

    Please use bellow code in your themes function.php file.

    add_filter('wcqrc_product_permalink', 'wcqrc_product_permalink', 10, 2);
    function wcqrc_product_permalink($permalink, $product_id){
        return $permalink . $utm_parameters; //where $utm_parameters is your product UTM parameters
    } 

    Replace $utm_parameters variable with UTM Parameters.

    Thanks and Regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    I created a file functions.php in the child theme folder, added the above code to this file, replaced $utm_parameters variable with UTM Parameters.
    Do I do right? What else should I do?

    Plugin Author Bappa Mal

    (@bappa1995)

    That’s all check if this works.

    Thanks and regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    It doesn’t work, unfortunately.
    QR code scanner shows only a url without UTM Parameters.

    Plugin Author Bappa Mal

    (@bappa1995)

    @aliputin,

    Give us the UTM Parameters which you want to include and we will give you the exact code.

    Thanks and regards,
    Bappa

    Plugin Author Bappa Mal

    (@bappa1995)

    @aliputin,

    Do you have refresh qr code of that product after applying the code? You can make it by clicking on refresh button on that product through admin back end.

    Thanks and regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    Yes, I refreshed the qr code.
    Here is my utm:
    ?utm_source=qr-code&utm_medium=online_homedeco&utm_campaign=0001_&utm_content=0001_&utm_term=0001_

    Plugin Author Bappa Mal

    (@bappa1995)

    Hi @aliputin,
    Please use bellow updated code in your child theme function.php file and don’t forget to refresh the qr code of that product.

    add_filter('wcqrc_product_permalink', 'wcqrc_product_permalink', 10, 2);
    function wcqrc_product_permalink($permalink, $product_id){
        $utm_parameters_args = array(
            'utm_source'=> 'qr-code',
            'utm_medium' => 'online_homedeco',
            'utm_campaign' => '0001_',
            'utm_content' => '0001_',
            'utm_term' => '0001_'
        );
        
        return esc_url(add_query_arg($utm_parameters_args, $permalink));
    } 

    Looking forward to your co-operation regarding the same.

    Regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    Thank you for helping.
    It works now.

    Plugin Author Bappa Mal

    (@bappa1995)

    @aliputin,

    Happy to hear from you that the customised code works.

    Please give us 5/5 if you like this plugin.

    Regards,
    Bappa

    Thread Starter aliputin

    (@aliputin)

    Another issue came out. After scanning a QR code, an ampersand sign & in a url is converted into & #038; sign. And that doesn’t allow Google analytics to read variables (except the first variable).
    For example, I expected:
    mysite.com?utm_source=10&utm_medium=11&utm_campaign=12&utm_content=13&utm_term=14
    In fact, I’ve got:
    mysite.com?utm_source=10& #038;utm_medium=11& #038;utm_campaign=12& #038;utm_content=13& #038;utm_term=14

    Do you know how to fix it?

    * & #038; without a space between & and #

    • This reply was modified 7 years, 1 month ago by aliputin.
    • This reply was modified 7 years, 1 month ago by aliputin.
    • This reply was modified 7 years, 1 month ago by aliputin.
    Thread Starter aliputin

    (@aliputin)

    Any suggestions?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘UTM parameters in your qr code plugin’ is closed to new replies.