Updating Smart List with only domains

Troy_Larson
Level 3

Updating Smart List with only domains

Hi there Marketo world, 

Have a question for you all. We want to run a program where we issue a coupon code to users. However, once they claim it, we want to block that domain, so that no one at that domain is able to claim that coupon code again. 

I know I can look up "not in Smart List" but that is for  unique email address, not a domain-wide block. Any ideas on how we can expand that would be much appreciated. 

-Troy

4 REPLIES 4
Chris_Wilcox
Level 9

Re: Updating Smart List with only domains

Hi Troy,

I'm not familiar with how you create and issue coupon codes, but could you, as users redeem their coupons, simply add their domain to the smartlist with the filter of Email Address [contains]: @domain.com?  

Not sure what I'm missing here - looking up a domain is pretty simple with a smart list filter and the 'contains' operator instead of 'is'

2019-11-01_16-11-35.png

SanfordWhiteman
Level 10 - Community Moderator

Re: Updating Smart List with only domains

Well yes, if manually added... but the idea is someone comes in from @example.com and others from @example.com are automatically blocked from running through the SC.

The only way to do this is via webhook (which is a pretty simple once you move to that level).

Troy_Larson
Level 3

Re: Updating Smart List with only domains

Hey Sanford Whiteman, not to bog you down - but would be curious to learn how one would do this. Do you know of any resources where they start to lay that out?

SanfordWhiteman
Level 10 - Community Moderator

Re: Updating Smart List with only domains

but would be curious to learn how one would do this. Do you know of any resources where they start to lay that out?

Assuming you still have your API key, the FlowBoost webhook payload would be:

var emailDomain = ({{Lead.Email Address}}.match(/@(.+)/) || [""]).pop().toLowerCase(),
counter = "/coupon_counters/{{Program.Id}}/" + emailDomain;

FBCounter.add(counter, {{Lead.Id}})
.then(function(newEntry) {
success({
domainAlreadyUsed : newEntry.body.prevNode ? true : false
});
});‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

This'll return one of two simple responses:

{
"response": {
"domainAlreadyUsed": true
}
}‍‍‍‍‍‍‍‍‍‍

{
"response": {
"domainAlreadyUsed": false
}
}‍‍‍‍‍‍‍‍‍‍

Then use that to determine whether the coupon code has already been claimed for that domain.

The counter name includes the {{Program.Id]}, so it creates/uses a different counter depending on the program that has the Call Webhook campaign. This allows you to have a test Program and a prod Program and they automatically check different counters. (I think you're already doing this with event registration.)