Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No example for push.json request #1

Open
SeanDKendle opened this issue Dec 2, 2016 · 1 comment
Open

No example for push.json request #1

SeanDKendle opened this issue Dec 2, 2016 · 1 comment

Comments

@SeanDKendle
Copy link

SeanDKendle commented Dec 2, 2016

I'm unclear how to upsert to the push.json endpoint.

I've successfully pushed to Marketo, and associated the lead by email, but it fails to continue tracking events like page visits and link clicking once that happened. I assume the cookie value was sent incorrectly.

Every example that I see has the cookie being urlencoded()'d, and then sent as part of the URL. I'm trying to send it as part of the mktToken field in the input array of JSON objects.

Does this look right, or am I screwing this up?

        $curl_post_data = json_encode(array(
                            "lookupField" => "email",
                            "reason" => "Logged in",
                            "input" => array(
                                array(
                                   "email" => $userEmail,
                                   "mktToken" => urlencode(filter_input(INPUT_COOKIE, "_mkto_trk")), 
                                   "UserName" => $user['username']
                                )
                            ),
                            "programName" => "Lead Acquisition"
                        )
        );

Or should I not urlencode the cookie value?

@everlyd
Copy link
Collaborator

everlyd commented Dec 3, 2016

Couple of things:

  1. You should pass "mktToken" string for your lookupField value.
  2. You should pass the non-urlencoded value for the mkt_tok query parameter for your mktToken value.
    Something like this:
$curl_post_data = json_encode(array(
                            "lookupField" => "mktToken",
                            "reason" => "Logged in",
                            "input" => array(
                                array(
                                   "email" => $userEmail,
                                   "mktToken" => urldecode($_GET['mktToken']),
                                   "UserName" => $user['username']
                                )
                            ),
                            "programName" => "Lead Acquisition"
                        )
        );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants