Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Anonymous
Not applicable

Unable to retrieve campaign using campaignId from activity detail endpoint

Hi All,

We need to understand why the API is returning certain data in a specific scenario we have.

We create a program, then we clone an existing activity (Send Email) from another program (the second program has a campaign associated to the activity).

After that, we approve the new program which contains an activity and no campaigns.

Screenshot_1.png

When we use the API to retrieve all the activities (type= Send Email) we noticed the cloned one has a campaign  ID that we don’t see in the campaign list from the API (and that we don’t have in the UI, remember that we created this activity with no campaign associated).

Screenshot_2.png

Campaigns:

Screenshot_3.png

Is there any explanation in why that campaign id is added?

Is there a way to retrieve that phantom campaign from the API?

Can we consider that campaign ID an internal value Marketo need to add under the hood?

Thanks,

11 REPLIES 11
Justin_Cooperm2
Level 10

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

An Email Program (what you show above) is an abstraction of a Marketo Smart Campaign. The Email Program itself has an ID (1028 in your example above) and when it is run, Marketo auto-creates a child smart campaign that's job is to execute the Email Program. This campaign is not generally visible to a Marketo user in the UI (think of it as hidden) but it would correctly corresponds to the "Send Email" activity that would occur on a lead if they received an email from this Email Program. So, it has nothing to do with cloning, this is the result you would get with any Email Program that has already been sent out. You should have enough info in the API result to identify that the "Send Email" was associated with a Marketo Email Program.

Anonymous
Not applicable

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Hi Justin, thank you for this priceless information! That was our guess, now we confirm

Is there any way we can retrieve that "hidden" campaign info using the REST API?

Is there any other service we could use to retrieve it?

Bests

Justin_Cooperm2
Level 10

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Which info about the campaign are you looking for?

Anonymous
Not applicable

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

We're looking forward to import (hopefully) the same info as the other campaigns to be able to list them together.

Drew_Loika
Level 2

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Given an email open activity, what is the context ie what is it associated with? Email opens contain the id of the campaign but not the program. So how do I analyze email opens without knowing where the email came from in the first place?

Drew_Loika
Level 2

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Any thoughts on this? If an activity doesn't have a Campaign I can't tell where it originated.

Jep_Castelein2
Level 10

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

Not sure whether I fully understand the question, but it sounds like you get Email Open activities and you'd like to know which Program the email is in? To accomplish that, download all Folders through the Folder API. This listing includes Programs, because a Program is a special type of folder. Also download all Emails. Now you can look up the Email's Folder in the Email table, using the primaryAttributeValueId from the Email Open activity as the unique key. If this folder is of type "Program" then you've found the Program right away. If not, traverse the Folder hierarchy to find the first Folder of type "Program".

The Folder API provided limited details on the Program. You can use the Program API to get full details.

Drew_Loika
Level 2

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

*poke*

Kenny_Elkington
Marketo Employee

Re: Unable to retrieve campaign using campaignId from activity detail endpoint

There's not really a readily available way to perform this association right now.  I've opened up an improvement ticket to see when we can get these returned in the Get Campaigns response.