How to get program name for activity

Anonymous
Not applicable

How to get program name for activity

I am trying to pull all the registrations on the landing pages. I pull all the activities for form filled using activity ID 2 and it does not have a program or camapaign ID. Is it possible to know the program name for a given activity?

8 REPLIES 8
Grégoire_Miche2
Level 10

Re: How to get program name for activity

Hi Naresh,

It should have the program name but not the ID.

-Greg

Anonymous
Not applicable

Re: How to get program name for activity

Hi Greg,

Thank you for your response. I am not getting program name in my response for activities.json and as per the endpoint reference documentation they are saying campaign id is optional and they do not list program name. Please let me know if I missing something.

http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Activi...

Thanks,

Naresh

Grégoire_Miche2
Level 10

Re: How to get program name for activity

This question belongs to the "products" section. The "community" one is for question about the community itself.

-Greg

Anonymous
Not applicable

Re: How to get program name for activity

Thank you, I have changed to Products.

Grégoire_Miche2
Level 10

Re: How to get program name for activity

More people will see it there, and you will be more likely to get some other answers.

-Greg

Jep_Castelein2
Level 10

Re: How to get program name for activity

Currently Program is indeed not returned via the API. Most customers are extracting "Change Status in Progression" (= Program Status changes), activity ID 104. Generally, a Form submission will result in a Program Status change, and this will return the Program Name/ID.

If you really need to tie the Form submission to a Program, use "List Folders" API to download all folders to a local database. Lookup the Form Folder ID and traverse the folder tree until you hit a folder of type "Marketing Program". That is your Program.

I have filed an enhancement request to return Program Name as part of the Form activity API, but I don't know if/when that would be implemented.

Sean_Cronin
Level 1

Re: How to get program name for activity

Is this still the best approach, or have there been any changes to the API to make this easier?

SanfordWhiteman
Level 10 - Community Moderator

Re: How to get program name for activity

Filled Out Form activities have the same response payload as of this writing.

But if you're using Program-specific forms on Marketo-hosted LPs (which you probably are, in order for the folder-traversal workaround to even be considered) you can add the built-in {{Program.Id}} variable as a hidden field to the form!  Just give the field any name, like currentProgramId:

MktoForms2.whenReady(function(form){

  form.addHiddenFields({

    currentProgramId : +"{{Program.Id}}"

  });

});

And it will show up in the API results in the Form Fields complex value.