Tiny Pineapple

ananas comosus (L.) minimus

What’s Really Going on With Facebook Link Previews and Amazon Affiliate Links

Last night, as I was fooling around with Facebook’s new timeline feature, I noticed something rather odd. Facebook appeared to be altering some of the Amazon affiliate links that people were posting; removing any reference to their affiliate ID, and taking credit for the referral itself.

After experimenting a bit and confirming my preliminary findings, I posted the following incendiary nugget on Twitter:

When you post an Amazon affiliate link on Facebook, THEY REPLACE YOUR AFFILIATE ID WITH THEIR OWN in the preview/thumbnail links. Wow.

— Grettir Asmundarson (@grettir) on December 19, 2011

…and promptly went to bed. My plan was to do more research in the morning and figure out what was really going on.

(“Facts can wait until morning!” That’s my motto, and I’m sticking with it.)

Anyway, as I was driving my daughter to school this morning, my phone started going crazy with notifications of re-tweets and replies. And while I answered people’s questions as best I could based on the previous night’s experiments, I hadn’t yet had a chance to delve back into it, so I didn’t have all the answers.

Well, I still don’t have all the answers, but I have enough of them now to provide people with a more detailed explanation of exactly what’s going on.

If you want to cut to the chase you won’t hurt my feelings. But for lovers of minutiae, we’ll start with the basics.

Facebook Link Previews

As you’re typing your status updates on Facebook, if you happen to type (or cut and paste) a URL, Facebook will take that URL and auto-generate a “link preview” that features a nice, clickable icon as well as a title and description of the link’s destination. It then appends that pretty link preview to the bottom of your status update.

Here’s a basic example:

Facebook Link Preview

I quite like them. They add some visual interest to your wall/timeline and make your status updates stand out from the text-heavy crowd. I’ve also found that people are much more likely to click on the links in the pretty link preview than they are to click on the ugly, raw, auto-linked URL in the body of the status update itself.

And you’d think that the links in the auto-generated link preview would point to the same URL that you just typed in your status update, right? Well, in a lot of cases, they do. For instance, if you look at the previous screenshot, you’ll see that when you mouseover either of the links in the link preview area, the URL (which shows up in the browser’s status bar) matches the one you typed in your status update.

But this isn’t always the case, and it certainly isn’t the case for Amazon affiliate links.

Amazon Affiliate Links

Amazon affiliate links contain a unique affiliate ID that ensures you get credit for any traffic you send their way. In my case, a typical bare-bones affiliate link might look something like this:

http://www.amazon.com/exec/obidos/ASIN/B001ADOWO6/ref=nosim/tinypineapple

That bit at the end is the important part. Without it, Amazon has no way of knowing that I was the one who referred the customer to them and, as a result, I wouldn’t receive my annual check for less than $10.

(It’s true. So far this year, I’ve earned less than $10 from Amazon affiliate links, so I don’t really have a dog in this fight. I’m just doing this out of curiosity.)

When you post that Amazon affiliate link on Facebook, the auto-linked URL in the body of the status update points to the URL you’d expect it to (again, note the browser’s status bar):

Facebook Link Preview: Amazon Link A

…but when you mouseover either of the two links in the link preview, you discover that they send you somewhere else entirely:

Facebook Link Preview: Amazon Link B

Instead of pointing to the intended Amazon affiliate link…:

http://www.amazon.com/exec/obidos/ASIN/B001ADOWO6/ref=nosim/tinypineapple

…Facebook is sending people here:

http://www.amazon.com/dp/B001ADOWO6/ref=tsm_1_fb_lk

In this new mystery URL, my affiliate ID (tinypineapple) is nowhere to be found, having been replaced by some “ref=tsm_1_fb_lk” nonsense that appears to credit Facebook with the referral. (ref=something_something_facebook_like/link?)

I initially thought the problem might be that I was using old-school affiliate links, but all the modern variants produced the same result.

I also tried using bit.ly to shorten the URLs, thinking that Facebook might then leave them alone. Unfortunately, when creating the link preview, Facebook automatically expands shortened URLS and follows all the redirects, leaving you exactly where you were before.

Speculation

Some people were speculating that Facebook hates affiliate programs and is trying to foil them by stripping the affiliate IDs from the links. But if that’s was the case, why would they only alter the two links in the link preview and leave the URL in the body of the status update untouched?

Others speculated that Facebook was merely sanitizing the URLs and stripping off any query strings in the process. But:

  1. Amazon affiliate link URLs don’t contain a query string, per se. There’s no separator followed by one or more field-value pairs. (e.g. ?wubba=null) There’s nothing to strip.

  2. Surely the indiscriminate stripping of query strings from URLs would break too many sites. They’d never get away with it.

One thing that seemed to bolster the anti-affiliate argument was the discovery that iTunes affiliate links are also being stripped of their affiliate IDs…but that’s because the entire query string is disappearing.

iTunes affiliate links that start out like this…:

http://itunes.apple.com/us/album/wish-list-single/id401188569?uo=4&partnerId=30&partnerId=30&siteID=_oX3u15HhzE-lHjNxoUPkor7doSOJEls2A

…end up like this:

http://itunes.apple.com/us/album/wish-list-single/id401188569

To see if query strings might really be the issue, I posted some links to LandsEnd.com, which relies pretty heavily on query strings, and this was the result:

Facebook Link Preview: Lands End

It’s a little hard to see in the cropped screenshot, but here’s the original URL:

http://canvas.landsend.com/pp/TurtleneckSweater~214496_-1.html?bcc=y&action=order_more&sku_0=%3A%3AAN9&CM_MERCH=IDX_Women-_-Sweaters&origin=index

And here’s what you end up with in the link preview:

http://canvas.landsend.com/pp/TurtleneckSweater~214496_-1.html?cm_mmc=SocialMedia-_-Canvas-_-ProductShare-_-facebook

Where in the world did that come from? Well, I’ll tell you where it came from…

What’s Really Going On

When Facebook detects a URL in your status update, the first thing it does is perform a basic “auto-link” on the URL in the body of your status update. But to build the link preview, it tries to get fancy. It sends its crawler to the destination site and grabs the web page you’re linking to.

  1. If the web page in question has an Open Graph Protocol property="og:url" meta tag, Facebook will completely ignore the URL you entered in favor of the URL specified in the meta tag.

    So, since our LandsEnd.com destination page contains the following meta tag:

    <meta property="og:url" content="http://canvas.landsend.com/pp/TurtleneckSweater~214496_-1.html?cm_mmc=SocialMedia-_-Canvas-_-ProductShare-_-facebook"/>

    …that’s the URL Facebook will use in the link preview, no matter what we originally typed.

  2. If the Facebook crawler can’t find the proper Open Graph meta tag, it looks for a rel="canonical" link tag instead. And, if it finds one, Facebook will completely ignore the URL you entered in favor of the URL specified in the link tag.

    So, since our iTunes affiliate destination page contains the following link tag:

    <link rel="canonical" href="http://itunes.apple.com/us/album/wish-list-single/id401188569" />

    …that’s the URL Facebook will use in the link preview, no matter what we originally typed.

  3. If neither of the above conditions are met, only then will Facebook concede that you might actually know what you’re doing and build the link preview using the URL you told it to use in the first place.

The Missing Link

The “canonical URL” angle had occurred to me earlier, but it didn’t seem to explain that Amazon mystery URL. If you look at our destination page on Amazon, it doesn’t contain any Open Graph meta tags, and even though it does have a rel="canonical" link tag…:

<link rel="canonical" href="http://www.amazon.com/Strange-Beautiful/dp/B001ADOWO6" />

…that doesn’t match the mystery URL we’ve been looking for.

The trick is that Amazon is sniffing user-agent strings and is only inserting Open Graph meta tags when the page request comes from Facebook’s crawler.

But if you spoof your user-agent string and set it to “facebookexternalhit/1.0 (+http://www.facebook.com/externalhit_uatext.php)” you’ll get the full complement of Open Graph Protocol tags which are normally hidden from users, including…:

<link rel="canonical" href="http://www.amazon.com/dp/B001ADOWO6/ref=tsm_1_fb_lk" />

Bingo.

Conclusion

Let me make this perfectly clear: I was wrong.

What my original tweet should have said was:

When you post an Amazon affiliate link on Facebook, FACEBOOK DOES NOT REPLACE YOUR AFFILIATE ID WITH THEIR OWN in the preview/thumbnail links.

What they do instead is throw your affiliate link out the window entirely in favor of the one that Amazon is insisting is the canonical link, and that canonical link doesn’t include your affiliate ID (so HARD CHEESE!), but it does contain a snippet of code that gives Facebook (rather than you) credit for the referral.

As to whether Facebook earns any affiliate dough from that referral, I don’t know…but is there any link on Facebook that they don’t monetize?

Of course, the real irony here is that this problem is caused by the fact that Facebook is trying to do the right thing. It’s allowing sites to specify their own canonical links, which (in theory) is supposed to be the ideal. But when that ideal results in two-thirds of your links pointing to the wrong destination, that’s a problem.

So, if you’re posting Amazon affiliate links on Facebook, please keep in mind that the two links that are arguably the most attractive links in your status update (the icon and the title in the link preview) aren’t really your Amazon affiliate links…which means you’re probably not getting credit for most of the traffic you’re sending their way.

Incident at South Pass

The author, the following day...obviously still deeply traumatized by the Incident at South Pass.
The author, the following day…obviously still deeply traumatized by the Incident at South Pass.

The fact that we had to make an emergency roadside bathroom stop at South Pass, only 30 miles outside of Farson, Wyoming, was entirely my fault.

We’d stopped in Farson, of course, because…well…we always stopped in Farson when we were driving to my grandparents’ house in Lovell, Wyoming, because the Farson Mercantile offers two irresistible enticements to the weary traveler:

  1. The last public restrooms for a hundred miles.
  2. Ice cream cones with scoops of ice cream as big as your head.

My mother always required us to make use of the former before we could partake of the latter, so I dashed into one of the stalls (I was, after all, a very modest young man), deposited 1/2 oz. of urine into the toilet (so I could say that I’d gone), splashed some water on my hands in the sink (so I could say that I’d washed them), and then dashed back to receive my massive frozen dairy orb. Half an hour later, my ice cream cone was empty, but my five-year-old bladder was not.

My father pulled the Oldsmobile Vista Cruiser over to the side of the road and we all piled out. My Aunt Carol, who was caravanning with us, also stopped and the adults stood chatting by the cars as the kids scattered into the brush beside the highway. (Apparently I wasn’t the only one who had rushed his visit to the restroom.)

Roadside bladder relief is a tricky business under the best of circumstances, but the desolate high plains of Wyoming offer their own unique set of complications. For one thing, there are no trees to be found. And while there’s an abundance of sage brush on the side of the highway, the clumps closest to the road are quite scrawny. So, if you want any privacy at all, you have to venture farther out where the brush is a little taller. But it’s a delicate balancing act. If you don’t go far enough you’re still perfectly visible from the road, but if you go too far your odds of encountering a rattlesnake or being mauled by a prairie dog go up exponentially.

Being sensitive to my aunt’s presence, on this particular occasion I opted for distance over safety. I knew I was taking a chance venturing so far from the road, but I figured that if I was fast I could heed nature’s call and still sprint back to the car ahead of any rabid antelope that might be in pursuit. In my haste to finish, however, I — how shall I put this — “didn’t ensure that all luggage was properly stowed in the overhead compartment” and…

To fully appreciate this story, one must keep in mind that the zippers of 1968 were not the same Teflon-coated wonders that we enjoy today, with their perfectly-aligned, microscopic teeth and flawless operation. No. Back then, zippers were primitive contraptions with jagged teeth the size of your fist that were smelted from raw iron ore and crudely forged by amateur vikings in factories that manufactured zippers during the day and then switched to making razor wire at night since little or no retooling was necessary.

The zippers of 1968 were also prone to getting stuck. If you didn’t zip them up in a single, smooth motion they’d get stuck halfway up and you’d have to wrestle them back down and make a second run at it. I wasn’t sure what the National Park Service’s Rabid Antelope Threat Level was that day, but I wasn’t going to take any chances. I knew that I had to get it right the first time, so I gave the zipper on my pants a firm, decisive yank and…

Me:AAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHH!!!

My mother had been standing next to the car talking to my Aunt Carol, but my first blood-curdling scream brought her running. Unfortunately, it brought my Aunt Carol running as well.

The Two Women: (Running toward me.) “What’s wrong!?! What’s wrong!?!”

As I mentioned before, I was a very modest young man, so I was not about to let a female relative see me with “Shackleton trapped in the pack ice,” if you will. So as they ran toward me, I turned and hightailed it in the opposite direction.

Me: (Running.) “AAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHH!!!

The Two Women: (Chasing.) Where are you going!?! What’s wrong!?!

Me: (Still running.) “AAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHH!!!

The Two Women: (Still in pursuit.) “Stop running!!! What happened!?!”

Me: (Not stopping.) “AAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHH!!!

At this point, I realized that I was a good 50 yards from the road, and suddenly remembering the rabid antelope threat, I executed a wide, arcing turn that would take me back toward (but not too close to) the road. Unfortunately, my mother and aunt followed me on my new trajectory and I grew increasingly frustrated that these seemingly intelligent women couldn’t seem to take a hint. Could they not see that I was, as Bertie Wooster once said, “in urgent need of quiet and repose?” Yet they continued in their pursuit.

The Two Women:Stop running!!!

Me: (Finally able to form words.) “NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!!

The Two Women: “Come back!!! Come back!!!”

Me:GOOOOOOOO AWAAAAAAAAAAAAAAAAAAAAAAY!!! GOOOOOOOO AWAAAAAAAAAAAAAAAAAAAAAAY!!!

The Two Women: Tell us what’s wrong!!!”

Me:NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!! GOOOOOOOO AWAAAAAAAAAAAAAAAAAAAAAAY!!!

After executing a few more broad sweeps through the brush, I looked back and was relieved to see that the women had finally stopped chasing me. But they hadn’t given up. Instead, they were pointing to either side of me and making sweeping gestures as they conjured up some diabolical plan for my capture. It was like something out of an African nature documentary where two lionesses single out the the weakest member of the herd (in this case, the baby wildebeest with the velociraptor clamped to its loins) and conspire to take him out.

I knew I had to think fast, and it suddenly occurred to me that if they could not be deterred, perhaps they could be deflected.

Me:GET DAAAAAAAAAAAAAAAAD!!!

The Two Women: “What!?!”

Me:GO GET DAAAAAAAAAAAAAAAAD!!! I NEED DAAAAAAAAAAAAAAAAAD!!!

Thankfully, this had the desired effect. After conferring for a moment, they walked slowly back to retrieve my father and I found a mercifully tall clump of sage brush to stand behind while I awaited rescue. Back at the car, there was a brief animated discussion between the two women and my father (though, if you ask me, their haphazard serpentine gestures didn’t do justice to my brilliant evasive maneuvers in the brush), after which my father started making his way out to my location. As he approached, I stepped out from behind the sage brush, looked down at my fly, then back up at him, and announced, “I’m stuck.”

My father was a fighter pilot during the Cold War and it is a testament to his military training that not a flicker of emotion crossed his face as he crouched down and surveyed the situation. He made a few attempts to dislodge the zipper, but the tiny pull tab on my size 5 jeans was difficult to grasp with his large adult fingers, so after fumbling with it for a few minutes he put his hand on my shoulder and said, “I need to go get something from the car. I’ll be back in less than a minute. Will you be OK?” I sniffed and nodded and he returned to the car where my my mother and aunt were huddled waiting for news.

My father is nothing if not a man of discretion, so I was confident that he would provide the ladies with enough general information to put their minds at ease without revealing the exact intimate details of my predicament. Whatever he told them, they seemed to take it well, but I could still tell that they were a upset because they turned their faces away from me and I could see that their shoulders were shaking slightly.

After rummaging around in the back of the station wagon for a minute, my father closed the tailgate and began hiking back to my location. It wasn’t until he was about twenty feet away that I saw the pair of pliers in his hand…and it was then that I contemplated abandoning the life and people I had come to know and love and taking my chances on the open range.

I imagined that one day Shoshone tribal elders would tell their grandchildren stories of a mysterious feral child who roamed the plains, howling at the moon, wearing nothing but a pair of ill-fastened blue jeans. Who knows? Maybe I would have even gotten a cool Indian name out of it. But before that scenario could play itself out in my head, my father was back with the pliers on the zipper’s pull tab and a firm grip on my waistband…most likely for leverage, but also, I think, so I couldn’t make a break for it.

“Are you ready?” he asked.

I wiped the tears from my cheeks with the back of my hand, put my hand on his shoulder to steady myself, and nodded my head resolutely.

“OK, here we go,” he said, gripping the pliers tightly.

We both took a deep breath.

“One…two…”


As you can see from the photo above, I do not appear to have suffered any long-term ill effects from my self-inflicted (and, might I add, totally redundant) high-country bris. But if you’re ever driving through South Pass, I would encourage you to pull over to the side of the road, turn off your car engine, step outside for a moment, and listen.

Of course, you’ll hear the wind as it whips across the Continental Divide, and depending on the threat level, you might even hear the distant frothing of a rabid antelope. But even decades later, if you listen very, very carefully, in the upper registers you might just hear the plaintive howl of the pathetic creature who, if things had gone differently, the Shoshone might still be referring to as “Little Pronghorn.”

Her Majesty’s Gardener Reloaded

Her Majesty's Gardener Reloaded

An Announcement

After a seven year hiatus, I’m pleased to announce the new and improved Her Majesty’s Gardener with new chapter illustrations by the illustrious Christopher Lynn.

For those of you may not have even been alive at the time, Her Majesty’s Gardener is an online serial teen romance adventure novel that I started writing back in 2004. Unfortunately, after completing the first five chapters, I had to put it aside. (Single parenthood is not as conducive to writing as J.K. Rowling’s experience would lead one to believe. Go figure.) The idea was that I’d come back to it when my daughters were a little older.

Well, guess what? My daughters are a little older.


An Introduction

If you’re new to Her Majesty’s Gardener, here’s what the book jacket would say if it was a real book and it had a real jacket.

Grim normally would have spent the summer mowing widows’ lawns in his small Idaho hometown. But when he lands a summer job in England caring for the grounds of one of the Queen’s lesser-known castles, he’s thrilled.

Princess Victoria normally would have spent the summer practicing her impressive repertoire of rude hand gestures on the paparazzi who hound her everywhere she goes. But when security concerns force her to cancel her trip abroad and spend the summer cooped up in one of her grandmother’s dilapidated ruins, she’s appalled.

Oil, meet water.
With so much in common, what could possibly go wrong?

(Yeah, I know. I’m still working on that last line.)


An Invitation

Finishing this thing could be interesting, to say the least, and I’d love to have you along for the ride.

If you want to follow Her Majesty’s Gardener and be notified when new chapters are posted, you can do any (or all) of the following:

And I’d love to hear what you think, so if you have any comments or questions feel free to leave them in the space below, post something on our Facebook wall, or send us a message on Twitter.

Del Monte Pineapple-Grapefruit Drink

Del Monte Pineapple-Grapefruit Drink

Neatest trick in years — and DEL MONTE did it!

Like the sunny juice of pineapple? The refreshing tang of grapefruit? You’ll say they’re twice as much fun together in this great Del Monte discovery! Here’s flavor made to order for tots, teenagers, old-timers — everybody! And besides being differently delicious, Del Monte Pineapple-Grapefruit Drink is fortified with healthful Vitamin C. Have a glassful soonest — it’s the best reason you’ll ever have for being thirsty!

While the entry for “CITRUS FRUIT JUICES, CANNED” in the FDA Defect Levels Handbook specifies maximum acceptable levels for Mold (AOAC 970.75) and Insects and Insect Eggs (AOAC 970.72), it is strangely silent on the subject of Clown Backwash (WAKA 970.79).

Think about that before you “Have a glassful soonest!”