How Do I Add a Google AdWords Conversion Tracking Tag to WordPress?

Adding a Google AdWords conversion tracking tag to WordPress is fairly simple. To do so, you will first need to create a new custom post type in your WordPress site. You can find instructions for doing this on the WordPress Codex website.

Once you have created the post type, you will need to add the conversion tracking code to the post’s header. To do so, open the post’s header and locate the section. Within the section, you will find the following code:.

Next, you will need to add a line to your wp-config.php file that will allow WordPress to access the Google AdWords conversion tracking code. To do so, open the file and locate the line that reads:

// Enable Google AdWords conversion tracking.

define(‘GOOGLE_ADWORDS_CONVERSION_TAG’, true);

Finally, you will need to add a line to your WordPress theme’s functions.php file that will tell WordPress how to access the Google AdWords conversion tracking code. To do so, open the file and locate the following line:

add_action( ‘wp_enqueue_scripts’, ‘my_custom_script’);

add_action( ‘init’, ‘my_custom_script’);

add_action( ‘wp_print_styles’, ‘my_custom_script’);

add_action( ‘admin_menu’, ‘my_custom_script’);

add_action( ‘save_post’, ‘my_custom_script’);

add_action( ‘delete_post’, ‘my_custom_script’);

add_action( ‘update_post’, ‘my_custom_script’);

function my_custom_script() {

// Get the Google AdWords conversion tracking code

GOOGLE_ADWORDS_CONVERSION_TAG = true;

}

Once you have added the conversion tracking code to your WordPress site, you will need to configure Google AdWords to use the code. To do so, open the Google AdWords account that you use for conversion tracking and navigate to the Settings page.

On the Settings page, you will find the Conversion Tracking section. Within the Conversion Tracking section, you will need to click on the Add Custom Conversion Tracking Tag button and enter the code that you added to your WordPress site.