Scott W. Bradley

in which scottwb thinks out loud

Fork me on GitHub

Tracking Facebook Ads With Google Analytics

| Comments

By default, Google Analytics does not do a very good job at categorizing traffic you receive from placing an ad on an external ad network such as Facebook Ads. In the case of Facebook in particular, traffic referred from your ad will show up as “direct” or generically as “facebook” because of they way the redirect the user to your ad through their own analytics back-end.

The intended way to track through this redirection is using “UTM codes”: parameters appended to the URL you use in your ad, that lets Google track that user’s behavior on your site for the lifecycle of their visit. This is great, because you want to know more than just how many people have clicked on your ad. You want to know what they do once they get to your site (e.g.: if they buy something).

Below is a quick primer on getting setup so that your Facebook Ads can be properly tracked with Google Analytics.

Twitter Image Search and Download

| Comments

Last night the sunset in the Seattle area was in rare form. You might have thought there was a double rainbow by the way everyone was going on about it. My wife even noted that her Facebook feed was filled with pictures of it.

So I thought it would be funny to scour Twitter for all the pictures of it that I could find and post them to Facebook just to be a smart-ass.

I sat down to whip out a quick-and-dirty script to do this for me. By the time it was ready, I had lost the smart-ass urge to post them to Facebook, but what I ended up with turns out to be a handy little tool.

Have Some Fun With Your Tests

| Comments

I just came across this test case in some old code I had forgotten about:

1
2
3
4
5
6
7
8
9
it "validates that the address is geocodable" do
  @user.address = "Death Star, Suite 1138"
  @user.city    = "Moon System"
  @user.state   = "Endor"
  @user.zipcode = "1138"

  expect{@user.save!}.to raise_exception ActiveRecord::RecordInvalid
  @user.errors[:address].should include "could not be found on the map"
end

It reminded me of something I actually think is important: have a little fun with the examples in your test cases. Not so much as to be distracting, but a little humor can add some fun to an otherwise mechanical, boring task.

I like to think of the guy who comes along a year later trying to understand my code by reading the tests. Telling a small story or making some pop-culture references will hopefully brighten his task.

I’ve Moved My Blog to Github

| Comments

It seems like more and more in the development community, I’m seeing blog posts titled “I’ve moved my blog to Github”. After hearing so much about the combination of Octopress and Github Pages, I figured I’d give it a look.

The result is what you see here. This is of course still a work-in-progress. I’d like to customize my own theme and style, but the default one provided by Octopress is so nice that I’m perfectly happy to let this sit for a while.

I could go on and on about how great Octopress is, and how I love the workflow based on git and rake, but dozens of others have already done this for me. For example: http://jtimberman.housepub.org/blog/2011/09/29/blog-moved-to-github-pages/

A Link to My Old Blog

| Comments

I am starting a new blog here at scottwb.com, and moving away from my old blog Sleepless Coding.

There are a few reasons for this:

  • The name “Sleepless Coding” reflects the young, machismo, code-all-night attitude that I used to live by. This is no longer the way I choose to best further all my goals in life. That’s a subject for another post, but in short, I have found that I am way more productive when I’m “in the zone”. Like any athlete, to be “in the zone”, I need to get enough sleep at regular, natural hours.

  • Blogger is terrible. Why is that post-entry box so small? It’s as if they still think we all have 640x480 monitors. There are many things I dislike about Blogger. One of which is that it is not well-suited for sharing code.

  • I prefer to be able to have intimate control. I want to dig in to the CSS.

  • I want my site to become more than just a blog. Hosting it myself will give me better freedom to do that.

The new blog is still in its early stages, but it will be published soon and I’ll start tweaking it incrementally.

All of my old posts can still be seen at my old blog Sleepless Coding.