SOLVED

How to get the token posted to the Landing Page?

Go to solution
Highlighted
Anonymous
Not applicable

How to get the token posted to the Landing Page?

Hi,

I am new to Marketo. I have a landing page and I want to use it to listing in a marketplace.

In Market Place is when the customer/subscriber clicks on the listing (Landing page URL ), it posts a token ( using x-www-form-urlencoded) to the mentioned landing page.

Is it possible to get the value of the token into a hidden field in landing page?

Thanks,

Beniton

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: How to get the token posted to the Landing Page?

It seems you're misinterpreting the purpose of this token. It's not enough for it alone to be posted to Marketo, it needs to be associated with the Marketo Munchkin cookie for the current browser session on your site. (And it also needs to be immediately exchanged for the permanent customer identifier and product code, which need to be stored back to the same lead, but if you could connect it with the correct lead, that exchange can be accomplished via webhook.)

It would be simple to have the Marketplace page POST the token to the Marketo /save endpoint. But that alone wouldn't get you anywhere, because it would create a new lead in Marketo with only that one field filled in (not an Email Address or any other info). It also wouldn't have anywhere to redirect from there, because Marketplace is POSTing only one field and /save requires a redirect URL as an additional query param (retURL).

In order for this interaction to work, you'll need an intermediate gateway. It'll be very lightweight, but is necessary to tie the pieces together. It will process the Marketplace token together with the session's first-party cookies. With that information it can exchange the token, associate the lead, and redirect to the next user-facing page.

View solution in original post

8 REPLIES 8
Highlighted
Level 10 - Community Moderator

Re: How to get the token posted to the Landing Page?

Your question is a bit jumbled (sorry).

Are you trying to post a non-Marketo HTML form, hosted on a Marketo LP, to a remote endpoint?

Please explain the data flow in more detail.

Is it possible to get the value of the token into a hidden field in landing page?

The value of a Marketo {{lead.token}} or {{my.token}}? Of course, just output the token directly into the value of an <input type="hidden">.

Highlighted
Anonymous
Not applicable

Re: How to get the token posted to the Landing Page?

Hi Sanford,

    We are trying to list a product in AWS market place. To list a

product in AWS market place we need to submit a SaaS URL to AWS for

product listing.

We are planning to submit one of our landing page URL to AWS as a SaaS

URL.  But as per AWS the product subscription happen in like below.

1. Customer finds the product listing in AWS market place.

2. Subscribes to the product clicking on subscribe button in AWS market

place.

3. AWS market place generates a token and POST it to our SaaS url (

which in our case is a marketo landing page )

4. So now my question is it possible to populate this token in a hidden

field?

5. I think if  the LP is called with query parameter it is possible to

store it to the hidden filed in LP (GET call), but I am not sure how

POST calls are handled with respect to marketo

Sorry for long email, Thank you for your response.

From AWS docs

https://docs.aws.amazon.com/marketplace/latest/userguide/configuring-your-saas-application-to-accept-new-customers.html

/The customer’s browser sends a POST request to your SaaS registration

URL. The request contains one POST parameter, x-amzn-marketplace-token,

containing the customer’s registration token/

Thanks,

Beniton

Highlighted
Level 10 - Community Moderator

Re: How to get the token posted to the Landing Page?

It seems you're misinterpreting the purpose of this token. It's not enough for it alone to be posted to Marketo, it needs to be associated with the Marketo Munchkin cookie for the current browser session on your site. (And it also needs to be immediately exchanged for the permanent customer identifier and product code, which need to be stored back to the same lead, but if you could connect it with the correct lead, that exchange can be accomplished via webhook.)

It would be simple to have the Marketplace page POST the token to the Marketo /save endpoint. But that alone wouldn't get you anywhere, because it would create a new lead in Marketo with only that one field filled in (not an Email Address or any other info). It also wouldn't have anywhere to redirect from there, because Marketplace is POSTing only one field and /save requires a redirect URL as an additional query param (retURL).

In order for this interaction to work, you'll need an intermediate gateway. It'll be very lightweight, but is necessary to tie the pieces together. It will process the Marketplace token together with the session's first-party cookies. With that information it can exchange the token, associate the lead, and redirect to the next user-facing page.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: How to get the token posted to the Landing Page?

Hi Sanford,

The purpose of the token it to call ResolveCustomer service, which would give me customer code and product code.

I can use a aws javascript sdk to call ResolveCustomer service from LP if i somehow get the token populated when Marketo Loads the LP with form,

But i think there no possibility of getting the token from LP posted by marketplace.

So as per the below suggestion, my SaaS URL has to be different one, which would accept marketplace token -> resolves customer code and product code and then redirect to Marketo LP with query parameters right?

Thanks,

Beniton

Highlighted
Level 7

Re: How to get the token posted to the Landing Page?

Marketo landing pages are HTML pages, there's no way you will be able to read the POST body from the front end. As you have concluded, you'll need an endpoint in, e.g. php, a language that can read the POST body and append it to the Marketo landing page URL.

Highlighted
Anonymous
Not applicable

Re: How to get the token posted to the Landing Page?

Thank you so much JayJiang. I will inform my client on the feasibility of this proposed solution.

Highlighted
Level 10 - Community Moderator

Re: How to get the token posted to the Landing Page?

As Jay says, you can't read the POST request payload (unless it is deliberately echoed back in the response, not at all default behavior).

But even if you could read the original POST data, you wouldn't be able to call the AWS SDK from the browser. That connection is secured by your AWS keypair and is never to be shown to the public.

Highlighted
Anonymous
Not applicable

Re: How to get the token posted to the Landing Page?

Thank you very much Sanford Whiteman, for helping me.