Tracking Code
-
The tracking code you sent me works like a dream. To remind you:
function alx_extras_add_link_ga($url){ $url = str_replace(‘rel=’, ‘onClick=”_trackEvent(\’Affil\’, \’Amazon\’, \’%ASIN%\’);” rel=’, $url); return $url; } add_filter( ‘amazon_link_template_get_link_open’, ‘alx_extras_add_link_ga’, 22, 1 );
add_filter( ‘amazon_link_template_get_rlink_open’, ‘alx_extras_add_link_ga’, 22, 1 );
add_filter( ‘amazon_link_template_get_slink_open’, ‘alx_extras_add_link_ga’, 22, 1 );I want to put this into the functions.php of a child theme (auto-generated by an ingenious plugin) so it doesn’t get nuked on theme updates but don’t know where to put it… it looks like this:
<?php
// Exit if accessed directly
if ( !defined( ‘ABSPATH’ ) ) exit;// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED – Do not modify or remove comment markers above or below:if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’ );
}
endif;
add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’ );// END ENQUEUE PARENT ACTION
Do I just tack it on the end?
- The topic ‘Tracking Code’ is closed to new replies.