Slackbot Hates Server Side Post | Community
Skip to main content
John_M
Employee
November 1, 2016

Slackbot Hates Server Side Post

It's true. Here at Marketo we use Slack, and our Slackbot HATES server side post.. so much so that when you mention it, it chastises you. It's really pretty amusing.

Fine! Jeez.

Really though, Slackbot is completely right. Server side post has effectively been replaced by the following REST endpoint, which is great and scalable.

http://developers.marketo.com/rest-api/lead-database/leads/#push_lead_to_marketo

This, along with my other most recent blog, provide a good blueprint for associating leads in a non marketo form with only one REST call. No fewer than 3 customers have had this very question for me this week alone, so it seems like a hot topic.

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

16 replies

SanfordWhiteman
Level 10
July 11, 2017

Right. It wouldn't be the mktToken anyway (that's a different lookup). The docs are really confusing on this.

Translate
Digital_Pi66
Level 1
July 10, 2017

Thanks Sanford.  I noticed in your sample you use  "cookies" for the field name.  Not "cookie" and not "mktToken" as the Push documentation example uses. 

So it seems the documentation has an incomplete description and a completely wrong example.

Translate
Level 4
June 29, 2017

Hmm that's pretty interesting, but if it doesn't back-fill activities, that's a non-starter for us.

On a semi-related note, I'm about to roll out a big change you suggested to route all cookies through our Salesforce instance, then delay association until the Salesforce lead syncs to Marketo, but I wonder if this will break campaigns that send emails.

For example, if I have a campaign that will send an email with the trigger being a specific Visits Web Page activity, in the past, I'd call associateLead from Munchkin, then trigger the web page activity so it'd happen for a lead with an email. Then that smart campaign would send an email.

Now, I'd create the lead in Salesforce and have the cookies added to that lead, then log the web activity without calling associateLead from Munchkin (anonymous in Marketo's eyes). Then, within a few minutes, Salesforce would sync to Marketo, and I'd trigger a webhook to associate the Munchkin cookie with the lead, at which point the previously anonymous Visit Web Page activity would retroactively be associated with the new synced lead from Salesforce, which has an email too.

In this scenario, would my email fail to send since the Visit Web Page event happened before Marketo knew the email? If so, I'm sad I forgot about this major issue, is there any workaround?

Translate
SanfordWhiteman
Level 10
June 29, 2017

...verified with support...

I wish they'd stop verifying things that aren't totally true.

This endpoint actually can associate leads with formerly anonymous cookies. Example request payload:

{

    "programName": "API Association",

    "source": "Outside Site",

    "reason": "Visited Web Page",

    "lookupField": "email",

    "input": [

        {

             "email": "marketotestpush+01@gmail.com",

             "cookies": "id:111-XOR-333&token:_mch-s.codepen.io-1498705469993-12345"

         }

    ]

   }

This will associate new web activities under that cookie with the new lead.

However, the problem I've found is that it doesn't back-fill activities, only forward-fills them after the time of association (which is sort of like having cookieAnon:false). So the functionality is self-defeating in a way, especially if you're looking to batch requests, since you may not know the cookie-email correlations until well after the person has closed their browser.

Translate
Level 4
June 28, 2017

I've concluded and verified with support that push cannot have anything to do with cookie association. The only way to associate cookies is via associateLead with Munchkin, associateLead with the REST API, or by submitting a form with the cookie - either normally from a client / browser or from server side POST.

Translate
June 28, 2017

I cannot get the PUSH api to accept a field named cookie at all.

POST to <server>/rest/v1/leads/push.json

{

    "programName": "xxx",

    "source": "xxx",

    "reason": "Form Fillout",

    "lookupField": "email",

    "input": [

        {

            "email": "test@example.com",

         "firstName": "testxxx",

         "cookie": "id:999-<xxx>"

         }

     ]

}

gives me back:

{

    "requestId": "561#15cefe249ec",

    "result": [

        {

            "status": "skipped",

            "reasons": [

                {

                    "code": "1006",

                    "message": "Field 'cookie' not found"

                }

            ]

        }

    ],

    "success": true

}

Translate
Level 4
May 5, 2017

I tried that too but no luck. Perhaps it's not possible? It seems like the intent of the push API is to upsert leads and update fields by either email or by mkt_trk token from an email link. However, I couldn't find any docs to indicate that you'd actually be able to associate a Munchkin tracking cookie with it. The only reason I thought to try was that @Justin Norris​ above was asking if we could use push to associate, and your post here https://nation.marketo.com/blogs/marketowhisperer/2016/10/25/associating-leads-with-non-marketo-form-fills#comment-27895 implied that perhaps Push Lead could replace Get and Associate.

For posterity, here's what I just tried

Request

POST https://<munchkinId>.mktorest.com/rest/v1/leads/push.json

{"programName":"Push Leads Test","lookupField":"email","input":[{"email":"test@example.com","firstName":"Updated via push leads w/ cookie","cookie":"id:..."}]})

Response

[{"id":123456,"status":"created"}]

I was hoping I could associate 300 tracking cookies at once if this worked out, but without it there's still the form submit or associate REST API for 1 cookie at once, so no biggie.

The more concerning thing is that I seem to have created multiple duplicate leads somewhere between the 3 things I'm testing:

1. Push lead via REST (docs say "this is always an upsert operation")
2. Submit form (docs say "an anonymous lead is merged into a new or existing known lead when someone: ... Fills out a Marketo form)

3. Use REST API to associateLead​ (I'd assume this should behave similarly to associateLead in Munchkin and the docs from #2 say that scenario should also merge leads for you)

Shouldn't duplicates be impossible for these scenarios?

Translate
SanfordWhiteman
Level 10
May 4, 2017

Has to be supported, otherwise the endpoint doesn't make a whole lot of sense.

I'm on a plane right now so can't verify, but try lookupField:email and pass cookie:<cookie value> in the lead record.

Translate
Level 4
May 4, 2017

Bummer, bulk associate would be awesome!

I'll resort to 1 call per cookie association using a form POST by default, with a fallback to associating via REST API in case that stops working or in case my server's IP is rate limited or banned.

Although it wouldn't help this use case, I tried "lookupField": "cookie" for kicks, but that doesn't work.

Error: 1006 - Lookup field 'cookie' not found

Translate
SanfordWhiteman
Level 10
May 4, 2017

"lookupField" : "cookie"

No?

Translate