Thursday, July 22, 2021

Google Ads: Creating a Hash from an email address in SFMC

Google Ads allows you to upload email addresses into Google Ads and then target (or suppress) ads to people who own those email addresses.  

If you want to protect your PII, you may be required to upload the email addresses as an SHA-256 hash.  Google Ads will allow you to upload in plain text, but if you don't like having that kind of data lying around on your end, you'll want to hash them.  (If you don't, Google will immediately hash them as soon as they're uploaded.)

If you're using Salesforce Marketing Cloud (ExactTarget), the query to do the hashing is a little different than if you were to do the hashing outside of Marketing Cloud.  

Anywhere else:

@EmailAddress),2)) as HashEmail

CONVERT(VARCHAR(100),@EmailAddress,0)),2)) as HashEmail
A second convert step is needed in the process or it starts with the wrong data for hashing and ends up with a hash that doesn't match anything. Took a lot of trial-and-error and research to get to this, so hopefully it's useful.

Tuesday, July 06, 2021

AMPscript: Quickly Calculate Integers in SFMC / ExactTarget

There's no integer function in SFMC, but you can get there quickly with mod and subtract.

As a reminder:

mod(a,b) = remainder of a divided by b

subtract(c,d) = c minus d


= remainder of 5.5 divided by 1
= remainder of 5.5
= 0.5

= 5.5 minus remainder of 5.5 divided by 1
= 5.5 minus remainder of 5.5
= 5.5 minus 0.5
= 5


if your non-integer number is @numOriginal, your calculation 

set @numInteger = subtract(@numOriginal,mod(@numOriginal,1))

That's one fun secret... here's another: there are far more Email Marketing Jobs than there are people like us to do the work. Your next job may be waiting at

Sunday, June 06, 2021

Recent Reads

Some stuff I've read recently... these are Amazon links, you can buy the books and I'll get a few pennies in the process. (I used to say you were funding my coffee, but really, you're helping to buy me more books. If it's coffee, check out Drink Trade - and get a free bag of coffee!) 

Space Team (Volumes 1-12) by Barry J. Hutchison

These are popcorn books for science fiction fans.  I found myself devouring them at the start and then reading less and less as I got closer to the end, not wanting it to end. Incarcerated for identity theft, due to a case of mistaken identity, Cal Carver ironically is abducted from his cell by aliens. Up until that point, no one knew there was anyone else in the galaxy besides humans. Still processing this, Cal learns he's the last remaining human due to another clerical error. And thus begins twelve volumes of adventures, escapades, romps and capers across a galaxy filled with all kinds of interesting people, some of whom are nice. There are good books, not-as-good books, a few odd shifts in the "universe," some embarrassing titles and a good time I was sorry to see end. A satisfying set of stories with many, many laugh-out-loud moments.

Not One of Us by Debbie Herbert 

Years ago, high school girl's boyfriend and parents vanish. She finishes school, moves to the big city and starts her life. But now, she's back in the small town because her autistic brother's caregiver (her grandma) may no longer be able to care for her. Oh, and she has synesthesia -  she can see sounds. You learn this at the beginning and I really can't help you if it's not immediately obvious that this will come into play. The disappearance of that family isn't the only secrets the town holds and soon people start dying. And anyone and everyone is suspect. The protagonist is a middle-aged Matilda surrounded by cops whose lack of proper procedure (compared to what we see on TV) is astounding and, well, it's all just a mess. Halfway through the book we find out what happened to the family and you'd think it would have been a bigger deal, but it wasn't. 

A Deadly Influence (Abby Mullen #1) by Mike Omer

I liked Detective Abby Mullen. I didn't like most of the other characters in this book. You know how some stories constantly throw plot twists at you? I kept waiting for the plot twists here and they never came. Maybe some characters didn't play exactly the part I was suspecting, but apparently the detective was a superb judge of character. An interesting, modern idea overall, but I didn't much care for it.  I think I would give book two a try, though, since none of the prominent characters in this book would be back for a second call, as near as I can tell.

Abrupt, Unanticipated Destinations

I saw an old couch on the side of the road yesterday and it sparked a new thought in my head.  

I realized the couch had reached its destination, but that its utility had been in the journey. I finally understood, kind of, that saying about the journey being more important than the destination, or however the saying goes.

I've always hated the saying. For me, destination equalled something I wanted, something I was looking forward to.  The journey was torture, the waiting, the anticipation (and the possibility that the destination may not be a good enough payoff for the journey). I tended to take "journey" quite literally like family road trips, or junior high, high school and college -- times where I always felt I was "waiting for my real life to begin."

But I realized I had that same mentality when it came to work. I tend to leave jobs on other people's terms. There was one place where I thought I would work there until I retired. Once a year we'd have our service awards and someone who had been there 25, 30, 35 years would get up and give a speech.  I was amazed and how much they gave given towards the success of the organization and I imagined myself one day up there on stage giving a speech myself. But after eight years, they'd had enough of me and kicked me to the curb. In retrospect, that was good as my wife said I was probably clinically depressed for my last two years there and some pretty phenomenal things have happened since then. 

But this isn't about that, this is about me sitting on the curb, used up, discarded, told I was no longer valuable to the organization I had given eight years of my life to. I had quit my job, moved our family 1,100 miles to a new state because I thought God had told me, and then thought my employment with this organization (a Christian non-profit) was confirmation that I was following God's direction.  It's entirely possible that this was true at the time. (Moving my family back 1,100 miles since then has been great, but again, not about that.)

Because sitting on the curb (or rather, sitting in Costco getting a new cell phone since I had turned in my company-issued phone earlier that day), I questioned what was the point of it all. I couldn't see the journey, the contributions, how I had been instrumental for a time, perhaps what the organization needed, possibly even some aspects of my work living on after my departure, all I could see was -- as they say on American Idol -- I had come to the end of my journey. 

And the destination seemed pretty crappy.

But when I looked at the couch yesterday, I realized that it wasn't a bad investment because it was being thrown out, that it had been desired, specially chosen, and then served dutifully for who knows how long, through scary movies, exciting video games, distressing breaking news.  It may have been enjoyed by kids or pets or served as a temporary home for someone. It might have seen multiple homes. For that couch, it was definitely all about the journey and not the destination.

If life is a journey, there's quite a bit that's not so fun about our current journey, I find myself not so much wishing for my final destination, but knowing whenever it comes, it's going to be heartbreaking (and cruel) for those I leave behind. Not because I'm going to exit in a cruel way but because I'm responsible for people who will never be able to take care of themselves, one of whom won't understand why I'm no longer around.

So this whole journey/destination thing applied to my life is still a struggle for me to make sense of, but I think I can now better understand how to handle sudden destinations not of my choosing.

Monday, May 31, 2021

Recent Reads

More books I've recently read.... (links are to Amazon, in case you want to get them for yourself. And if you do, you're helping my coffee fund, so thanks!)

Have a Nice Day by Billy Crystal and Quinton Peeples

The President's having a bad day. And that's before he learns it's to be his last day on earth. This was a nice story that was fun to listen to. I think it was a polished table-read so there are a lot of different voice actors including a few well-known celebrities, which is a nice treat you don't get too often.  

Once More Upon a Time by Roshani Chokshi

The fairytale life has fallen apart, but the now separated couple must embark together on a journey through an enchanted land before time runs out. A nice use of the buddy/quest framework.

Nut Jobs: Cracking California's Strangest $10 Million Dollar Heist by Marc Fennell

An interesting investigative piece that really benefits from the Audible format because of the ability to include interviews and relevant ambient sound that helps you better understand where you are in the journey.

Second Skin by Christian White

A girl is killed in an accident, and then her mom dies. Years later, a young girl claims to be the reincarnation of the mom, knowing things she seemingly shouldn't know. It's an interesting take and I was really curious to learn how they were going to wrap this up.  Supernatural? Something else? Kept me guessing.  I enjoyed it.

The Second Life of Nick Mason (Nick Mason #1) and Exit Strategy (Nick Mason #2) by Steve Hamiton

Nick Mason is a bad guy, but not a really really bad guy. We're supposed to root for him.  He's exchanged one kind of prison for another after a drug lord gets his prison sentence dropped and he's free, but only so far as the drug lord's leash. The phone will ring, and when it does, whatever he's told to do, he must do. So Nick becomes a killer. But he's still the good guy of the story, so we're supposed to want him to succeed, but also get out of the life he's agreed to. But he still leaves a trail of destroyed lives in his wake and emerges time after time nearly unscathed. It's popcorn/airplane reading. I don't know if there are more books, but #2 seems to be a fine place for me to find my exit from the series.

Alexander X: Battle for Forever (Book 1) by Edward Saviq

Alexander ages slowly. In a lot of ways, he's only 15, but he's been alive for 1,500 years. It's not quite time travel, but it's close enough to the genre to pique my interest but also receive the extra scrutiny I reserve for time travel books. Alexander has met everyone famous. He's not a time traveler, but somehow he was always at the right place at the right time.  This bugged the crap out of me. So often we don't recognize big events until they're already upon us, or in some cases, in retrospect. But Alexander was somehow always in the right city and with the right people to even as a 10,11,12-year-old, be known by and friends with the famous adults throughout history. This was dumb, unnecessary and really distracting to me. Book 1 is essentially his origin story and first fight to introduce his nemesis.  By the time I got to the end of book 1, I wasn't interested in knowing where things went.  It was interesting enough, but not interesting enough to continue onto book 2.

Ready Player Two by Ernest Cline

I really enjoyed Ready Player One. I loved the references, I enjoyed the story.  It was a lot of fun. So when I heard that RP2 was available for pre-order, I said "Yes, please."  I guess the joke's on me because I paid full price for RP2 and then didn't even finish it.  It's almost as if Charlie received the Chocolate Factory but then morphed into one of the other bratty children and lived in his penthouse with even less concern about the state of things than Willy Wonka was. RP2 works too hard to find 80s references that weren't used in RP1 and then works just as hard to explain those references to you, worried that you won't otherwise get them. A number of other reviewers complained that it was "woke" - I don't like that term, but I would say that it tries to approach some of the current hot topics but does so clumsily, with a heavy hand, from a character (and possibly by an author) who wants to address the issues but is too far removed. I also think when RP1 came out, it was a kindler, gentler time and we were OK with OASIS (the Facebook-stand-in) being the world's preferred - and partially benevolent - online meeting place. Now with Facebook's toxicity and repeated missteps (not to mention that it's clear Zuckerberg has embraced the dark side with relish), it's also harder to imagine such a place, without it being a toxic cesspool.  So, yeah, I eventually dumped this and really recommend against it.

The Missing Sister by Elle Marr

The motivations of the characters in this book make no sense. The Paris authorities seem to lack basic common sense or procedural standards that any viewer would know after watching even a few episodes of any cop drama on TV.  Characters disappear.  Seemingly important characters are introduced really late. Convoluted and complicated backstories are slowly teased out through flashbacks. Everyone is suspicious and untrustworthy but also safe enough to be alone with if the story needs it. In short, this is a mess. I gave up.

Stuck by Chris Grabenstein

Kid doesn't age while everyone around him does. The characters were annoying and felt too childish and too grownup at the same time. Lots of sound effects. I see this is the second book from the same author that I've abandoned for the same sorts of reasons.  Don't recommend.

Sunday, May 23, 2021

Recent Reads

Some of my recent reads... links are to Amazon - if you buy any of these books, you're contributing to my coffee fund. Thank you!

The Galaxy and the Ground Within (Wayfarers #4) by Becky Chambers

I can't say enough about how important I think Becky Chambers' work is to anyone who writes fiction. Even if you don't like science fiction, Chambers does an amazing job of world creation and character development. In the fourth book set in the Galactic Commons universe, five people find themselves trapped together temporarily at a galactic rest stop. This "bottle episode" finds each learning more about themselves and each other and challenging their previously held beliefs about the other species they're now forced to spend time with and get to know. A unique aspect of the Wayfarers series is that you do not need to read them in order as they only loosely connect to each other. Cannot recommend enough. Even better - go for the audio version narrated by Rachel Dulude. 

Firefly: Big Damn Hero by James Lovegrove

One of the complaints about this story is that "it feels too much like the TV show." I do not see how this is a complaint. I feel like the author nails the mannerisms and speech of the series while bringing us a brand new story that also gives us a lot more backstory about Mal. I really enjoyed it and it has completely changed my mind about fan and other types of supplemental fiction to extend shows and movies I've enjoyed. It was nice to be back in the 'verse.  I really enjoyed it.

Silverswift by Natalie Lloyd

I think this was promoted as a youth title. My son and I regularly take rides in the car, so we listened to it during our drives. Eliza's grandmother's sight is fading, but she wants to have one last adventure with her granddaughter - to find a hidden cove where mermaids gather once a year. Of course, her mom thinks this is silly nonsense. It was a nice story, an entertaining way to spend a few hours.

How to Defeat a Demon King in Ten Easy Steps by Andrew Rowe

For centuries, the pattern has repeated - a Demon King arises and begins to take over the world. A Hero arises and saves them. Wash, rinse, repeat. Young Yui has studied this cycle. She's not Hero-material, but that's not going to let that stop here. It's LitRPG if that was just how your world worked, but it goes easy on the skills/stats. A well-crafted and creative experience. 

The Man on the Mountaintop by Susan Trott

This one will make you think but not make your brain hurt.  Joe has built himself a home on a remote mountaintop and people from around the world make a pilgrimage to his door to seek his wisdom. He's getting older and the idea of succession is weighing on his mind. Also, each year he invites a group to live with him during the spring months. The story is told through conversations where all kinds of issues are wrestled drawing from lots of philosophies. I never found it to be preachy and thought it was a terrific book. It does feel like two books, this may be the result of it being an adaptation from multiple books.

The Collapsing Empire (Interdependency #1) and The Consuming Fire (Interdependency #2) and The Last Emperox (Interdependency #3) by John Scalzi

Scalzi never disappoints. The Interdepency is a galactic federation controlled by a small group of wealthy families.  A new threat to the galaxy emerges that could upset this balance of power and also possibly threaten all of humanity. The warring houses will have to decide where their allegiances lie and whether they want to acknowledge the threat and if so, what it means for their businesses: life as usual, grab as much as you can now or maneuver in such a way to come out on top if humanity survives the threat. Some great characters and interesting universe.

The Inn by James Patterson and Candice Fox (Abandoned)

I couldn't figure out where this was going - it didn't hook me and I got bored.

Bacchanal by Veronica G. Henry (Abandoned)

The traveling carnival is Eliza Meek's way to escape her circumstances in depression-era south. A black orphan with the ability to communicate with animals is a good addition to the carnival which is not what it seems. I made it 60%, but I found most nights I wasn't reading much at all and finally decided I wasn't invested enough to keep reading.

Friday, March 19, 2021

TED: Inside the mind of a procrastinator

I can totally relate. The scary reminder/solution comes all too quickly in the last few seconds of this important talk.