Webhooks are EverywhereIt seems these days that everyone has a Webhook feature. You can fire Webhooks in Github when you commit code. You can send Webhooks in Trello when you create a card. Slack will let you set up an incoming or outgoing Webhook. Odds are good you will answer “Yes” to the survey question, “Do you expect to build webhooks in the next 3-6 months?” There is a good chance you’ll create a Webhook integration just because you can.

So what is a Webhook exactly? Even if you think you know, you should still go here to watch the hour-long video just to make sure.

Tealium WebhooksTealium has a good number of built-in integrations for client-side or cloud-delivery of your event and visitor data. Many of these integrations act a lot like a Webhook and will pass specific vendor-formatted data over HTTP POST. But let’s say you want to build your own. There’s a new cutting edge analytics service out there your college roommate built and you’d like to overload his servers with data. Your pal was a little too-smart-for-his-own-good and decided to deviate from the traditional key/value pairs and build a multi-level hierarchical JSON structure format to receive data. Of course he wrote great documentation on using Webhooks for incoming data.

Let’s take a few steps back. You’ve already implemented Tealium’s data layer on your web site. And you’ve even installed a Tealium Collect Library on your IoT device. These data sources are arriving at their AudienceStream destination as a set of event attributes. It seems like a long shot to translate the data to the custom format.

Just before you give up… you realize Tealium’s Webhook supports custom templating similar to what you already know from semantic template technologies Handlebars and Mustache. No need to change your IoT device code or modify your website JavaScript, just define a new custom Webhook in Tealium.

A Real-World Use Case?Personally, I’d like to know when someone is reading my blogs. Let’s say many people can’t get enough of my blog entries and are asking themselves if I might be the next Charles Dickens. I’d really appreciate getting a thumbs-up emoticon notification in Slack when this happens. And, I’d like to know this in real time. When someone reads three of my blog posts in the same visit, I must know immediately. Of course this may end up being a distraction from getting things done, but the regular positive vibes are sure to improve my brain’s effective productivity. I’d also like to know which specific articles were read (the name of the articles appearing in Slack alongside my thumbs-up message ?).

(1) I’ll start with the end in mind. After reading their docs, Slack appears to be able to receive this as an incoming Webhook in the following format:

The /BLAH/BLAH/BLAH endpoint is specific to me and I’m keeping that confidential.

(2) Now, I can setup a simple JSON template in Tealium’s Webhook Connector to send the same information in the same way. I have already configured a filtered stream called “test” so my Webhook will only fire from my test page (for now).

I have a simple rule called “Ty Blog Article View” that is used by two enrichments. The first keeps the blog post titles (post_title) in a Set of Strings. The second is a Number that stores the number of blog post pages viewed.

(4) Configure Audience in AudienceStream

I’m changing the Source of the Webhook to be visitor-based instead of my original test that was event-based. That means I need to create an Audience. My Audience is when someone has viewed three pages of blog type with author Ty Gavin. When someone joins this Audience in their current visit to tealium.com, I get notified immediately. Here is my Audience definition.

Here is event data that AudienceStream will use — the incoming data as seen in Universal Data Hub monitoring tool “Live Events” is below:

The following shows how I configure the Webhook to read the data from my set of blog titles and send along to Slack.

Here is my AudienceStream Webhook template that adds the articles names and the emoticon to the slack message. I had to read Tealium’s documentation to learn how to reference each of the 3 titles in my Set of Strings.

Here’s what it looks like in my Slack notification:

TIP:When testing, you can set the Webhook URL config value to a “http://requestb.in/” location instead of going directly to Slack’s endpoint to start with. That way, you can see the exact data sent and confirm it will comply with Slack’s desired format.

If you enjoyed reading this article, here are two other blog posts that you might want to consider reading:

Ty Gavin is a well-rounded Internet marketer and analytics consultant with a passion for problem solving. He brings a client-centric focus obtained from over 12 years supporting both installed and SaaS solutions for data modeling, web analytics and conversion optimization. He has hands-on experience in every aspect of digital marketing, spanning previous careers as a webmaster, marketing manager, implementation engineer, technical consultant and business analyst. Ty received a Bachelor of Science in Computer Science from Cal Poly, San Luis Obispo.

The Right Content

The Right Match

Utilizing a service to reveal what 3rd party services a visitor’s presumed company uses on their site. We then compare those against our own list of integrations, and if there are any matches, present those logos here.

The Right Market

Here we are using a reverse IP address lookup service to reveal a visitor’s industry. Then using that data point to relate to the visitor by powering personalized content.

The following are the options you could have been presented:

Not-Personalized

Healthcare

Retail

Financial

This website uses cookies. By using our services, you agree to our use of cookies. AcceptLearn More