7 Replies Latest reply on Sep 21, 2017 3:13 PM by Denise Greenberg

    Submitting Lead through API, Can I set the Source or Reason?

    Matthew Coyne

      When we submit an upsert change through the REST API, is it possible to attach a custom Source or Reason with the event?

       

       

      Normally, after I submit a change, I can see the updated field in that Lead's activity list, it shows the old value, the new value, the time of the change, a Source, and a Reason.

       

      If I log into Marketo and update a Lead by hand, the activity gets a Source of "Person update" and a Reason of "Manual person edit"

      If I go through the API, both fields get set to "Web service API"

       

      Could I have my API call save a reason like "My First API Application"

       

      http://marketohost.wpengine.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/syncLeadUsingPOST

        • Re: Submitting Lead through API, Can I set the Source or Reason?
          Christina Zuniga

          I have a lot of integrations and they all use "Web service API" which made it difficult for me to determine lead source. What I did was have each of those systems create a hidden field and I connected it to a custom Marketo field I call "Integration Source". Then all they do is pass along the data like "CVENT" or "Vidyard", etc.


          That field is overwritten each time a lead interacts with one of those, but I can have interesting moments fire off, lead source created, last lead source updated, etc. that allow me to see when that integration touched or created a lead. It works well for me!

          2 of 2 people found this helpful
            • Re: Submitting Lead through API, Can I set the Source or Reason?
              Denise Greenberg

              Hi Christina,

              I'm having the same issue. Could you please explain what you mean when you say those systems create a "hidden field" that you then "connect to" a customer Marketo field?

               

              Do you mean that you have the web service api sources write to your Integration Source field? I created a similar field called API Source that one of our web api sources writes to. I was considering getting the others to do so as well - but realized it would get over-written each time - which isn't helpful when troubleshooting. So I was thinking about blocking API Source from updates and creating an API Source Most Recent field that could get overwritten.

               

              Thank you,

              Denise

                • Re: Submitting Lead through API, Can I set the Source or Reason?
                  Sanford Whiteman

                  Sounds like a good idea to me, Denise.

                   

                  Note you can actually attach a Reason to the Push Lead API endpoint. This Reason remains attached to the Push Lead activity and can be queried.

                   

                   

                  However, not all API-based apps use this endpoint (I would venture that few do b/c they don't see the advantages). Push is a good substitute to for upserting leads in batches, but it doesn't allow for the pure bulk importing of the Bulk Import API.

                  • Re: Submitting Lead through API, Can I set the Source or Reason?
                    Christina Zuniga

                    Hi Denise Greenberg,

                     

                    I'm happy to explain! Most of the Launchpoint partners are able to put a hidden field on their native forms that send Marketo information without making that field visible to the person filling out the form. Here's an example from my CVENT set up:

                     

                    Notice how registration type is connected to the CVENT field with no default value but integration source is not connected to any field on the form (that's how it's hidden) and the default value sent is CVENT. So every time that a record is processed this field will be marked with CVENT without the person seeing it.

                     

                    Then on my end I have a smart campaign with a trigger looking for "person is created" or "data value changes: integration source new value is CVENT" with a filter of "integration source = CVENT".

                     

                    My flow steps are setting lead source, last lead source, interesting moments, sending alerts, changing program status, adding to list, etc., depending on the integration in question.

                     

                    I'm actually fine with having the integration source overwritten repeatedly if someone interacts with many channels because I have my first touch attribution through lead source captured, and multi-touch through interesting moments / program successes. So for me, it's not as important to keep this field untouched after the first time it's set, but your idea of having an original API source and then most recent API source makes sense. If you do that, I'd check to make sure that by blocking Original API Source from being updated, that you aren't blocking it from being set in the first place (that will depend on how you set up the block ).

                    1 of 1 people found this helpful
                • Re: Submitting Lead through API, Can I set the Source or Reason?
                  Grégoire Michel

                  Hi Matthew,

                   

                  No you cannot. The API does not provide the possibility to set your own values and it's not possible to change it afterwards.

                   

                  -Greg

                  1 of 2 people found this helpful