Conversion Tacking Code

  • Asim
    Asim
    Newbie
     
    11 points

    Hi there,

    I want to add conversion traking codes to thankyou page which is by default callback page. I reached to tpl-callback.php but as suggested needs to add the code in between head section while I can’t see any head tags there so where is the ideal location to drop FB and Adwords tracking code?

    Regards!


    Mark Fail
    Mark Fail
    Super Guru
     
    12,214 points

    Does it have to be in the head? most tracking code is javascript and can go anywhere.


    Asim
    Asim
    Newbie
     
    11 points

    Yes It has to go into head section, I put it “anywhere” in the page but its not working.


    Asim
    Asim
    Newbie
     
    11 points

    Mark, I need to add the codes. Where is the head section?


    Hemanta Chakladar
    Hemanta Chakladar
    Super Guru
     
    1,689 points

    your tpl_callback.php files call header.file once in the beginning of the file. Head section is in the header.php file. But header.php is called by every page.

    So, you can do one thing, in callback.php , don’t call the header.php instead copy the header file code and include your conversion code in the <head> section.


    Hemanta Chakladar
    Hemanta Chakladar
    Super Guru
     
    1,689 points

    open header.php and locate <head></head> in line 21-31 put your code there.

    And copy the whole file content and paste it in tpl_callback.php on line 7 REPLACING <?php get_header(); ?> part.


    Asim
    Asim
    Newbie
     
    11 points

    Well thanks Hemanta, your way might solve the problem but this is bit technical and one should not do it in the absence of the web developer. So I just installed plugins to ad facebook and adwords tracking code and that pretty simple and works fine.

    In case anyone else encounters the same problem should install these two plugins.

    https://wordpress.org/plugins/facebook-pixel-conversions-for-wp/

    https://wordpress.org/plugins/conversion-and-remarketing-code/


    Hemanta Chakladar
    Hemanta Chakladar
    Super Guru
     
    1,689 points

    Thanks you solved.


    Adela
    Adela
    Newbie
     
    72 points

    Thank you ASIM very much this was very helpfully for me!


Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.