SOLVED

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

Go to solution
zeljko
Level 1

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

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

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

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"
        }
    ]
}

 

 

View solution in original post

8 REPLIES 8
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

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

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).

 

zeljko
Level 1

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

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
Level 10 - Community Advisor + Adobe Champion

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

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.

 

zeljko
Level 1

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

So I would need to add _mkto_trk value in form submission data. Could I do that by having a filed in a form or can I simply send this value to _mkt_trk field.

 

 

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

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

If you're using Marketo's submitForm API endpoint to post data from your Zap, you could directly set the tracking cookie in the "cookie" parameter in the payload. If you're using the leads endpoint to submit person data to the Marketo, you'd need to use the associate lead endpoint to associate the Munchkin tracking cookie with the person (yes, a separate API call just to associate the cookie with the person). I like using formSubmit API over the vanilla leads API endpoint for posting person data submitted via the non-Marketo form to Marketo. Also, you need not have a dedicated form field to store the tracking cookie, passing it in the cookie parameter of the submitLeads API endpoint should suffice.

 

zeljko
Level 1

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

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": "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:000-ZTZ-527&token:_mch-wpengine.com-1234567891234-83805" }, "leadSource": "Website" } ], "formId": 1405 }

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

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

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"
        }
    ]
}

 

 

SanfordWhiteman
Level 10 - Community Moderator

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


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.