How can I post submissions and connect unknown user data on submissions from Azure b2c login | Community
Skip to main content
Level 2
February 17, 2023
Solved

How can I post submissions and connect unknown user data on submissions from Azure b2c login

  • February 17, 2023
  • 2 replies
  • 3725 views

Hi,

I'm trying to figure out what is the best way to send submissions to Marketo when someone signs up on Azure B2C login and how to connect this submission with unknown activity on our website.

 

Flow: User visits our webpage, we set Munchkin tracking code, user navigates to our product, they are redirected to new domain or subdomain (where Azure B2C login is active), user Sign up or Log in through B2C login, enters the product (completely new domain). 

Azure B2C login is closed of Microsoft login basically with it's own authentication so using an Marketo form is not possible.

 

We think of using Zapier for sending the data but then can we also connect known profile with unknown activity?

 

Is it possible to send tracking code to new domain/subdomain and send it with submission data?

 

Does anyone have experience with this kind of setup?

 

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 Darshil_Shah1

So would this JSON be ok for posting the data, I-m receiving an error Invalid content type, code 612


Content-Type: application/json Accept: application/json Body: { "input": [ { "leadFormFields": { "email": "john.doe@example.com", "FirstName":"John", "LastName":"Doe", "No365user":"1040" }, "visitorData": { "pageURL": "example.com/form-page", "queryString": "utm_source=google&utm_medium=cpc", "leadClientIpAddress": "192.168.1.1", "userAgentString": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3", "cookie": "id:000-ZTZ-527&token:_mch-wpengine.com-1234567891234-83805" }, "leadSource": "Website" } ], "formId": 1405 }


Could you please try using the REST API names of the fields in the request body >> leadFormFields and rechecking your headers? Adding the submitForm API reference here for reference.

The below call worked for me: 

Header:

'Accept: application/json' 
'Content-Type: application/json' 
Body:

 

{ "formId": 1225, "input": [ { "leadFormFields": { "email": "john.doe@example.com", "firstName": "John", "lastName": "Doe" }, "visitorData": { "pageURL": "https://example.com/form-page", "queryString": "utm_source=google&utm_medium=cpc", "leadClientIpAddress": "192.168.1.1", "userAgentString": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3", "cookie": "id:AAA-BBB-123&token:_mch-marketo.com-1234567890-21914" }, "leadSource": "Website" } ] }

 

 

2 replies

Darshil_Shah1
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 17, 2023

You can always use the background form submission to post non-marketo form data to Marketo. Given that person was already known (i.e., munchkin associated) on domain A and they'll be munchkin-associated once they fill out the form on domain B (posted to Marketo via the background form submission), IMO the person's activity log should include activities from both domains (unless I'm missing anything obvious here).

 

ZeljkoBrAuthor
Level 2
March 3, 2023

Hi, having Marketo hidden form in the background is not an option. I have to go with Zapier for pushing form data to my Marketo instance. 

 

So submission is not happening on Marketo form. Can I push some value on form submit to Zapier and save it on profile so it is connected?

Darshil_Shah1
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
March 3, 2023

Well, this would require your webpage to securely post data to a zap, which would then push data to Marketo. The latter part is easy, and for the former part (i.e., posting data to the zap), you could use Zapier webhooks. While this is practically doable, but you should not expose your webhooks on the client side as that could open a massive vulnerability IMO. I'd recommend sending data to the Zapier webhook using the backend instead. You could also pass the Munchkin tracking cookie to the backend and use it to associate the Munchkin session using the associate lead endpoint (this endpoint needs the lead id of the person for cookie association, so you'd need to get the lead using email first). This would eat up your API calls from your quota, though.

 

SanfordWhiteman
Level 10
March 3, 2023

Is it possible to send tracking code to new domain/subdomain and send it with submission data?


Of course, if  you control every possible entry point from Domain A to Domain B you can attach the Munchkin cookie to the URL so Domain B can read it. Won’t work if people can go directly to Domain B.

 

Re: the form submission, as Darshil mentions you need to be aware of REST API limits if you decide not to use a real form.