Dear Eric: Personalizing Your WordPress Blog (or website)
One of the things I liked about Dreams Not For Sale was its recommendation to personalize a user's interaction with your blog or site. What this means is that whenever you capture a visitor's name — usually by getting them to signup for your mailing list — you should use that name to address the user as much as possible. The book even includes free access to the author's $97 personalization course (”The Power of Personalization”) as a bonus — he really believes in the concept.
So I decided to try it with one of my newer WordPress blogs, the one hosting my free Why Keyword Elite? course. As you can see, the home page for the site is a standard “squeeze page” that collects the user's name and email address. Once that's done, they're sent to a thank you page that addresses them by name. Here's how you can do the same thing. Note that you can do this with a blog or a website, all you need is the ability to add some PHP code to your pages.
From Squeeze Page to Session
The trick is to use sessions to store the personalization data. Any decent autoresponder — I use AWeber exclusively and highly recommend it — has the ability to redirect the user to a “thank you” page after they sign up for your mailing list. This is where the personalization happens.
Instead of sending the new subscriber directly to my thank you page, I send them to a short PHP page that then redirects them to the correct page. When I create my squeeze page, I set the “forward variables” option so that the autoresponder signup process forwards all the user information entered into the squeeze page — typically “name” and “email” — to the post-signup destination page, i.e. my PHP page. Here's what my PHP script (personalize.php) looks like:
<?php
session_start();
if( isset( $_GET["name"] ) ){
$_SESSION["personalized_name"] = $_GET["name"];
$_SESSION["personalized_email"] = $_GET["email"];
}
header( "Location: http://www.whykeywordelite.com/how-to-buy-keyword-elite/" );
?>
As you can see, it's a very simple script. It first calls session_start() to create a session, or find an existing session. (PHP will set a cookie on the user's machine to identify the session. All of this is automatic.) It then pulls the “name” and “email” values sent by the autoresponder signup and stuffs them into session variables called “personalized_name” and “personalized_email” before redirecting the user to the real thank you page.
From Session to Personalization
Now that the user's name and email address are stored in the session, a simple bit of PHP coding is all we need to personalize our content for the user.
First we modify the header.php file for the theme we're using to define useful functions:
<?php
function isPersonalized(){
return isset( $_SESSION["personalized_name"] );
}
function getPersonalizedName(){
return $_SESSION["personalized_name"];
}
function getPersonalizedEmail(){
return $_SESSION["personalized_email"];
}
?>
Next, we install the PHPExec WordPress plugin. This lets us insert PHP commands in our postings. (If you're not using WordPress you don't need to do this, of course.)
This lets us refer to the user by name with a minimum of fuss:
<phpcode>
<?php if( isPersonalized() ){ ?>
<p><?php echo getPersonalizedName(); ?>, I'd like
to thank you for subscribing!</p>
<?php } ?>
</phpcode>
Of course, this would be nicer if it was all wrapped up in a plugin. Maybe I'll do that.
In any case, when Tammy subscribes to my course, she sees a thank you page that starts with “Tammy, I'd like to thank you for subscribing!”. And, if I want, I can continue using her name throughout the site, treating her like a unique individual instead of some faceless browser. Neat and easy enough to do!
Sponsored Link: Be sure to check out Viral Profit Machine for a viral list building system that encourages affiliates to send traffic your way.
Eric Giguere is the author of Uncommon AdSense and the award-nominated (that just means it lost!) blog Make Easy Money with Google and AdSense.
| Enjoyed this post? Get free updates by mail or by RSS! |