Home › Forums › Support › Selectively Add Code to Header This topic has 3 replies, 2 voices, and was last updated 6 years ago by Tom. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts March 30, 2018 at 3:45 pm #536659 Dorian Hey guys, I need to use Google Analytics’ experiment feature. I set up the experiment in Analytics, and it requires me to insert code in the head of one of the pages only. How do I insert that code into the head of just home page? Thanks, Dorian March 30, 2018 at 10:11 pm #536777 TomLead Developer Lead Developer You could do this in the wp_head hook in GP Hooks. 1. Get the slug of your page, it’s this part: mywesbite.com/my-page 2. Do this in the hook: <?php if ( is_page( 'my-page' ) ) : ?> Your code in here. <?php endif; ?> Hope this helps ๐ March 31, 2018 at 5:36 pm #537482 Dorian Hi Tom, Thanks for helping, that solved it. Cheers, Dorian March 31, 2018 at 8:24 pm #537536 TomLead Developer Lead Developer You’re welcome ๐ Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In