iMedia Ventures

Websites and Mobile Apps

Adding Google Conversion Script to WordPress Site

| 0 comments

Share

When someone signs up for a free or paid membership you usually send them to a thank you page. When someone buys one of your products this is known as a conversion. You should create a unique thank you page for each membership level, product, etc. When you use a membership system based on WordPress, which is known as a content management system (CMS) they usually use templates to create a web page. This means the header, footer and sidebar are often shared across the pages. This makes it easy to edit. You make a change in the footer file and it affects all pages instantly.

The problem is when you want to put a script for tracking conversions on a single page because the code usually needs to go in the footer near the closing ‘body’ tag. So you can use this script to check which page you’re on, and only include the script for specific pages. Here’s what I did for one of my sites:

<?php
if (is_page(‘thanks-for-joining’))
{ include (“conversion_free.html”); }
elseif (is_page(‘thanks-for-joining-silver-level-membership’))
{ include (“conversion_silver.html”); }
?>

You also have to create an html file and include the conversion script from that Google provides. Create one file for each conversion page and ftp it to the directory where your theme is. The ‘include’ statement will look in the current theme’s directory for the html files.

Good luck! Let me know if you have any questions!

To set up an inexpensive website that you can easily maintain yourself, as well as building email lists, shopping carts or membership sites, please see ourĀ internet consulting services.

Share

Leave a Reply