krish
krish

Reputation: 63

Marketo Api Get Email Sent, Email Open And Email Clicked

As part of the project requirement I need to get the email opened, Email Sent and Email Clicked data from Marketo fpr a particular campaign. How can we acheive this. I looked in to the api but not able to find a suitable one.

Any help is appreciated

Thanks

Upvotes: 2

Views: 2197

Answers (2)

Murtza Manzur
Murtza Manzur

Reputation: 1214

As Jep mentioned, you would need to request all the data from Marketo's Get Lead Activities REST API for these activities types, and then filter on your side. Here would be the steps to implement this:

1. Generate Access Token

Call Marketo's Identity API with your client id and secret to generate an access token. Please see Marketo's REST API quick start guide for more information.

<Identity Service URL>/oauth/token?grant_type=client_credentials&client_id=<custom_service_client_id>&client_secret=<custom_service_client_secret>

2. Call Get Paging Token API

Requires your access token from step one, and desired start date. The Get Paging Token API will return a token that is needed for a request to Get Lead Activities API in step three.

/rest/v1/activities/pagingtoken.json?sinceDateTime=2014-10-06T13:22:17-08:00

3. Call Get Lead Activities API

Requires your access token from step one and paging token from step two. You would need to specify the activityTypeIds for Email Opened, Email Sent and Email Clicked, which are activityTypeIds 10, 6, 11 respectively.

/rest/v1/activities.json?nextPageToken=GIYDAOBNGEYS2MBWKQYDAORQGA5DAMBOGAYDAKZQGAYDALBQ&activityTypeIds=10&activityTypeIds=6&activityTypeIds=11

4. Filter

Step three will return all activity data for the specified activity type and timeframe. The data will include an attribute for each record that specifies the particular campaign associated with it. You will then have to filter these records based on the campaign attribute.

Upvotes: 0

Jep
Jep

Reputation: 384

You can use getLeadChanges (http://developers.marketo.com/documentation/soap/getleadchanges/) and listen for Open, Sent and Clicked. You'll get all info for all campaigns in the database for a particular timeframe. On your end, you'll have to filter out the responses for the campaign that you're interested in. There is also a similar API call for the REST API: http://developers.marketo.com/documentation/rest/get-lead-changes/

Upvotes: 1

Related Questions