Jump to content
Sign in to follow this  
hypman

Advice on where to place javascript code for a/b testing?

Recommended Posts

hypman

Hi IM using Googles website optimzer and i need to test 2 pages but the instructions say to add the code after the tag, but there is no tag in my html. So i added the code at the top of the page but that leaves a big gap when viewed, How can i correct this please? thanks

Share this post


Link to post
Share on other sites
Jackey
Put the code in: PageLines > Custom Code > Headerscripts code

Share this post


Link to post
Share on other sites
hypman
Hi I only need to add the code to 1 page, (3 codes 1 each page,) does this still apply?

Share this post


Link to post
Share on other sites
Simon
No, that will add the code to every page. You will need to use some PHP. Not sure what product your using, but the code would look something like: if ( is_page( 'hello' ) ) { echo 'javascript for hello page here'; }

Share this post


Link to post
Share on other sites
hypman
Errrr, hmmm ok.As you might guess im a complete novice with php, If my url is http://www.mysite.com/page1 if ( is_page( 'http://www.mysite.com/page1' ) ) { echo 'javascript for http://www.mysite.com/page1 here'; } Would it be something like that, added in the header script code box? thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×