Placing Google Analytics code in Wordpress specific page

后端 未结 2 759
温柔的废话
温柔的废话 2021-01-26 10:56

I\'m trying to get Google Analytics Code to work on the thank-you page after customer has filled in the contact form and I\'ve tried putting it in the thank-you page which is in

2条回答
  •  星月不相逢
    2021-01-26 11:13

    I'm not 100 % sure whether it's possible at all to insert javascript with the tinyMCE Editor of Wordpress.

    If that's true, then you can try the following:

    1. Get the posts' ID: Look at the linking in your admin menu when you are in the view where you can see all your posts, e.g.

      http://www.your-url.com/wp-admin/post.php?post=796&action=edit

      796 would be your ID here.

    2. Enter the following in your header.php of your wordpress theme (to find at /wp-content/themes/theme-name):

    .

         
       //YOUR ANALYTICS CODE IN HERE
      
    

    Replace 796 with your ID here, and put your analytics code in between the PHP code.

提交回复
热议问题