Can I store code somewhere and call it in Marketo? | Community
Skip to main content
Troy_Larson
Level 3
February 7, 2020
Solved

Can I store code somewhere and call it in Marketo?

  • February 7, 2020
  • 1 reply
  • 4445 views

Hi everyone, 

 

I have a question for you all. So I have a promotion where we want only 1 person from a domain to receive a coupon code. So for example, person1@ABC.com fills out a form and gets their coupon. Then person 2 from @ABC.com attempts to fill out the same for for the same offer. What I'm trying to do is to block person 2 from @ABC.com from receiving the offer because Person1 already claimed it. 

 

The idea I had was to create some custom code that took the email domain and put it on a list, then checked that list for each subsequent form submission to see if that email domain was already on said list. The challenge I'm having is that my developer team does not want to store this information outside Marketo. 

 

So - does anyone know if there is a way to store this in Marketo and call this code to process when each person fills out a form?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Well, at the risk of being overly precise, the code must execute outside Marketo but need not be stored permanently outside Marketo. That is, you pass your logic to an external task runner which doesn't save anything, just runs and exits.

 

However the data must be stored outside Marketo, because that's how the different webhook executions can access the db of the already-used domains.

1 reply

SanfordWhiteman
Level 10
February 7, 2020

Is your Developer team concerned about security or just annoyance?  The data doesn't sound super-sensitive.

 

In any case, you can't do this kind of cross-lead coordination thing without using a webhook, and we do it 10s of thousands of times a day across lots of instances. 

Troy_Larson
Level 3
February 7, 2020

Hey @sanfordwhiteman thanks for the assist again! And basically to use a webhook the actual code lives outside Marketo - do I have that right?

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
February 8, 2020

Well, at the risk of being overly precise, the code must execute outside Marketo but need not be stored permanently outside Marketo. That is, you pass your logic to an external task runner which doesn't save anything, just runs and exits.

 

However the data must be stored outside Marketo, because that's how the different webhook executions can access the db of the already-used domains.