WordPress.org

Ready to get started?Download WordPress

Forums

Adding A/B testing html scripts tags?? (3 posts)

  1. Alex SWeekender
    Member
    Posted 2 years ago #

    Hi,

    Trying to add code from google website optimiser to do some A/B testing. Need to add the html script tags between the <head> tags on individual pages, but as the site is run off a theme I can't get into the <head> tags for each separate page? or can I?

    all help appreciated!

    Thanks

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    you can use conditional tags to add the code only for some of the pages:

    http://codex.wordpress.org/Conditional_Tags

    example (to be added in the <head> section of hader.php):

    <?php if( is_page('one') ) : ?>
    AB-CODE1
    <?php elseif( is_page('two') ) : ?>
    AB-CODE2
    <?php endif; ?>
  3. Alex SWeekender
    Member
    Posted 2 years ago #

    Brilliant! thanks it worked...

Topic Closed

This topic has been closed to new replies.

About this Topic