Last active
October 22, 2015 19:17
-
-
Save jonschr/c4149173b65fddd8bf46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Don't include the opening php tag | |
// Add a tracking script to a particular page, just before the </body> tag | |
add_action( 'wp_footer', 'tj_add_tracking_scripts' ); | |
function tj_add_tracking_scripts() { | |
global $post; | |
if ( is_page( 'your-page-slug' ) ) { | |
?> | |
PASTE YOUR SCRIPT HERE | |
<?php | |
} | |
if ( is_page( 'your-second-page-slug' ) ) { | |
?> | |
PASTE YOUR SECOND SCRIPT HERE | |
<?php | |
} | |
if ( is_page( 'your-third-page-slug' ) ) { | |
?> | |
PASTE YOUR THIRD SCRIPT HERE | |
<?php | |
} | |
if ( is_page( 'your-fourth-page-slug' ) ) { | |
?> | |
PASTE YOUR OTHER SCRIPT HERE | |
<?php | |
} | |
if ( is_page( 'your-fifth-page-slug' ) ) { | |
?> | |
PASTE YOUR FIFTH SCRIPT HERE | |
<?php | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment