July 28, 2007

Tracking Opt-Ins With Wordpress And Aweber

I've been using Wordpress to build most of my sites lately because it's so easy to get the structure of the site set up. You can just focus on the content and let Wordpress handle everything else.

Well, I'm a bit of a testing nut. I like to have as much information about my websites as possible. One of the things I like to know is which pages people are opting in from. That way, if opt-ins are my main goal for the site, I know which pages to promote more heavily.

I use Aweber for my list management and they let you assign tracking codes to your web forms so you can track which form your subscribers used to sign up.

The trouble is, you don't want to put a unique form on every page. That's one of the advantages of Wordpress - it handles it all through the theme's structure.

There is a fairly simple way around this, however. Because Wordpress stores all your content in a database, each page or post has it's own ID #. This technique uses that ID # to identify where your opt-ins are signing up from.

The first thing you'll need to do is download and install the ExecPHP Wordpress plugin. It can be downloaded from the following page:

http://ottodestruct.com/blog/2006/04/09/fun-with-widgets/

Once you've installed and activated the plugin, you'll have a new option in your "Widgets" screen under Presentation. Towards the bottom, there will be a drop down box titled "PHP Code Widgets"

PHP Code Drop Down

Make sure that drop down is set to at least 1.

Now in the "Available Widgets" section, there will be one called PHP Code 1. Drag that box up to the Sidebar 1 section.

Sidebar Setup

If you already have widgets in your sidebar, you'll need to decide where you want the opt-in box to appear. I recommend the very top if your main goal is getting opt-ins.

Next, log into your Aweber account and copy the HTML code for your web form.

Back on your blog's widgets screen, click the configure button for the PHP Code 1 widget.

Configure Widget

Give it a title in the first box (whatever you want) and then paste the web form code into the large box.

Opt-In Code

In the code for your Aweber web form, find the following line:

<input type="hidden" name="meta_adtracking" value="">

Whatever you put between the quotes after value= is the tracking code. What we want to do is have Wordpress automatically insert the page ID for whatever page your visitor opts in from.

Change that line to the following:

<input type="hidden" name="meta_adtracking" value="<?php if (is_home()) { echo('home'); } else { echo the_ID(); } ?>">

We've included a Wordpress function that will insert the ID for the page. Because the home page of the blog doesn't have a page ID, we're also checking to see if it is the home page. If so, it will assign a tracking code of "home".

Close the widget (click the X in the corner) and click the "Save Changes" button.

Now go to your blog's home page. You should see your opt-in box in the sidebar, wherever you inserted it in the list of widgets.

If you view the source for your home page and find the Aweber web form code, the ad tracking line should look like this:

<input type="hidden" name="meta_adtracking" value="home">

If you click on one of your posts and view the source for that page, it should have a number instead of home.

To track where people are signing up, you can use Aweber's reports to find the ad tracking codes that appear the most and cross-reference that number with the post ID's in your Wordpress blog to find the pages in question.

How you use that information will depend on several factors, which I'll go over in my next post.

Filed under Blogging, How To's by John

Permalink Print Comment

Comments on Tracking Opt-Ins With Wordpress And Aweber »

July 28, 2007
(Trackback)

PlugIM.com @ 3:33 pm

Tracking Opt-Ins With Wordpress And Aweber…

If you use Aweber and Wordpress, you can set it up to track where your subscribers are opting in on your website automatically. Find out how to configure Wordpress to track this information for you….

August 3, 2007

Maria Gudelis @ 10:43 pm

Very informative article that explains step by step how to do this even for a newbie!

August 8, 2007

Ken Little @ 12:42 am

Great highly informative article. Well worth the read

March 28, 2008

Keith Winter @ 1:14 pm

Very informative article. I´ve been trying to find a solution like this. Can´t wait to try it out. Thanks.

[...] Tracking Opt-Ins With Wordpress And Aweber [...]

June 20, 2008

Jon - Beauty Salon Marketing @ 5:00 am

Thanks for the article, that's really useful!

A quick question, if I may? Do you know of a way (script or plugin) to simultaneously register a new user in Wordpress and sign them up for Aweber? I.e. They fill in one form and it seamlessly adds them to both systems

Thanks, Jon

July 7, 2008

John @ 4:11 pm

I don't know of a plugin or script that will do that. There was one being considered for development on the KnowledgeConstructs.com blog, but it doesn't look like he had enough interest to go ahead with it.

August 21, 2008

Seree @ 1:27 am

Hi,

I've built a free plug-in to let you insert your Aweber opt-in form into your Wordpress blog both on sidebar and display as a pop-up with lightbox effect.

Very easy to use! and it's free!

http://www.fasterinternetmarketing.com/FasterIM-OptIn/

Thanks!
Seree W.

Leave a Comment

Subscribe without commenting