Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #297646

    Hello,

    I have a question. I am looking for a place to put a trackingcode. They say: “paste this code just before the end of the HTML body, that is before </body>”.

    What i did is looking in the theme editor and look for body. I can find header but after that i am lost. :-)

    Hope you could help me!

    Thank you so much!

    Greets Hans

    Edit: I put </body> in the title and it won’t display so i removed the </>

    • This topic was modified 10 years, 3 months ago by Hansnmgn.
    #297654

    Hi Hansnmgn!

    You can add Google Analytics code in Enfold theme options > Google analytics field.
    For any other code you need to add, please go to Appearace > Editor and open Header.php file and </body>

    Cheers!
    Yigit

    #297688

    Hi Yigit,

    Thank you for your quick replay. It is another code than Google Analytics.

    To make sure i understand it rigth:

    1) Go to Appearance
    2) Go to Editor
    3) Go to Header.php
    4) Look in the .Header.php for </body>
    5) place the code before the </body>

    After the </head> i have the folowing code:

    <body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank); avia_markup_helper(array('context' => 'body')); ?>>
    
    	<div id='wrap_all'>
    
    	<?php 
    	if(!$blank) //blank templates dont display header nor footer
    	{ 
    		 //fetch the template file that holds the main menu, located in includes/helper-menu-main.php
             get_template_part( 'includes/helper', 'main-menu' );
    
    	} ?>
    	
    	<div id='main' data-scroll-offset='<?php echo avia_header_setting('header_scroll_offset'); ?>'>
    
    	<?php do_action('ava_after_main_container'); ?>
    

    Must i place the tracking code insite this?

    Thank you!

    Greets Hans

    #297730

    Hi!

    Sorry i realized i made a mistake. I meant to say Footer.php file. You can also add following code to Functions.php file to add your script

    function add_my_custom_script(){
    ?>
    <script>
    PASTE YOUR CODE HERE 
    </script>
    <?php
    }
    add_action('wp_footer', 'add_my_custom_script');

    Cheers!
    Yigit

    #297849

    Hi Yigit,

    Thank you. It worked!

    Greets!

    #297862

    Hi!

    Awesome! Let us know if you have any other questions or issues Hans :)

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Insert code before body .’ is closed to new replies.