How to Add Google Experiment Code to WordPress Site
- SEO |
I'm running Optimize Press on this particular site and want to do a split test between two page variations to see which variation gets more clicks to an external site. I've created the event, experiment, and variations of the pages and got the code to put on my site. I tried plugins but none of them worked for me. At best it was saying the code was AFTER the basic GA code and it had to go before it. Eventually I just decided to put in the code myself.
Optimize Press has a field where you can paste in your GA code, so I pasted in my normal GA tracking code, and above that I pasted the experiment code GA gave me.
I put in my code like this:
<?php
if(is_page('my-page'){ ?>
EXPERIMENT CODE PASTED HERE
<?php } ?>
... with 'my-page' being the slug of the page title of the original page.
I'm still getting the message from the experiment that it can't find the code.
If anyone can explain how I'm screwing up here I'd be extremely thankful.
-
DivyaRai -
Thanks
SignatureSoftware development company{{ DiscussionBoard.errors[9938298].message }} -