Skip to content

Instantly share code, notes, and snippets.

@Pross
Created June 7, 2016 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pross/22e04d23949f510dc104260e452893ef to your computer and use it in GitHub Desktop.
Save Pross/22e04d23949f510dc104260e452893ef to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: A/B Test Google
Description: https://forum.pagelines.com/topic/40638-adding-experiment-tracking-code/
Version: 1.0
Author: Queue-It
*/
class QueueItGA {
function __construct() {
add_action( 'wp_head', array( $this, 'header_scripts' ), 10 );
}
function header_scripts() {
if( is_page( array( 15081, 695 ) ) ) :
?>
<!-- Google Analytics Content Experiment code -->
<!-- End of Google Analytics Content Experiment code -->
<?php
else:
?>
<!-- Google Analytics Content Experiment code -->
<!-- End of Google Analytics Content Experiment code -->
<?php
endif;
}
}
new QueueItGA;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment