What I’ve learned from a Facebook marketing campaign

To get more attention and hopefully, eventually more likes for Frederique’s Facebook page, I’m running a small marketing campaign in the last two weeks of the year. Here are some of my findings, a little after halfway through.

(Preface: the campaign is for winning free posters. For that, one only needs to share anything from the Facebook wall or like the giveaway’s post. More info about the campaign here.)

First, the campaign is set to run in the last 18 days of the year, within the most noise around – when everyone is already immune to ads. This was clearly not great timing, and I will avoid this in the future whenever possible. 

Second, I scheduled the post to go online on a Thursday, when I saw most of my peers active on Facebook. Also, I’ve let some close friends know about the post immediately and asked them to like or share it to gain more visibility. This worked well: some people liked the post a day later as well, showing that it was among the important ones (sharing it as an image probably added some extra points to its rank).

Third, my optimistic webcomic has a very special audience: almost every person is a potential follower, and therefore it was almost impossible to foresee the new followers. (This also means that I will have next to no chance narrowing down the audience for a future ad campaign based only on gender, age or similar values).

Fourth, the helpfulness of my friends is fantastic: their shares, likes and comments helped to show Frederique to hundreds of people in a week and meet the very modest goal of reaching the magic number – 50 followers of my Facebook page.

j j j

Moving my WordPress blog to Heroku (and Amazon S3)

Knowing that there are plenty of pages out there to walk you through the exact same thing, I won’t make this guide too long: only five steps, with some bullet points for future reference.

1. Create a Heroku project

  • Create an empty folder, locate it in Terminal and:
    $ git init
    $ git add .
    $ git commit -m "init"
    $ heroku create
  • Setup the name of the Heroku app and make your domain point to it
  • Add a ClearDB database to this Heroku project

2. Make a copy of your WordPress site

  • Download all WordPress files and copy them to the Heroku project’s folder
  • Create a dump of the database (the easiest way is to use this WordPress backup plugin)
  • In the Heroku project, make sure all domain values in the files’ content point to the right address. I had quite a few ‘hardcoded’ values in the footer still pointing to wimagguc.hu – a quick search and replace on all textual files took care of this.
  • Pro tip: if you had a .htaccess file, make sure to copy that as well

3. Migrate your database to ClearDB

  • Connect to ClearDB via MySQL Workbench (or a similar tool), and import the SQL dump you created in step 2.
  • Your articles and settings will still point to your old domain. Fix these with three simple updates:

    UPDATE PREFIX_wp_options SET option_value = replace(option_value, 'www.OLD-DOMAIN.com', 'www.NEW-COMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE PREFIX_wp_posts SET guid = replace(guid, 'www.OLD-DOMAIN.com','www.NEW-COMAIN.com');
    UPDATE PREFIX_wp_posts SET post_content = replace(post_content, 'www.OLD-DOMAIN.com', 'www.NEW-COMAIN.com');
  • Edit your wp-config.php:
    $db = parse_url($_SERVER["CLEARDB_DATABASE_URL"]);
    define("DB_NAME", trim($db["path"],"/"));
    define("DB_USER", $db["user"]);
    define("DB_PASSWORD", $db["pass"]);
    define("DB_HOST", $db["host"]);

4. Make The Heroku project run locally

  • (Now this step is far from mandatory, but I find it easier to add plugins and double check everything on localhost.)
  • You probably have your xAMP environment set up already. So did I, and therefore all I needed to do was to:
  • Set the CLEARDB_DATABASE_URL variable to whatever URI “heroku config | CLEARDB_DATABASE_URL” displays
  • Create a symlink to your apache document root: “ln -s /Users/wimagguc/heroku-wordpress-folder/ /var/www/heroku-wordpress-test”

5. Add S3 to handle file uploads

  • The best practice is to keep dynamic file content off from Heroku: in case you have multiple instances running, files uploaded to one dyno might be missing from other ones. Keeping all uploaded files on Amazon S3 is one way to solve this problem.
  • Go to amazonaws.com and register for Simple Storage Service (now there is a free usage tier for the first year!)
  • On the S3 console, create a bucket for your blog
  • Get the login credentials from Amazon
  • Install this great S3 for WordPress plugin and set it up to use with your bucket

Further reading:

j j j