Dynamics CRM Integration With Marketo

What is Marketo?

Like Mircosoft Dynamics Marketing, Marketo is a Marketing automation software which provides solutions related to

  1. Lead Management
  2. Sales Insight
  3. Revenue Cycle Analytics
  4. Social Marketing

It provides connectors which integrate the Lead, Contact between Dynamics CRM and Marketo.

Problem Statement

I recently did a project engagement in which the Sales Process was maintained in Dynamics CRM however the Marketing activities were to be handled in Marketo.

After the lead was captured and created in CRM, using out of box connector the lead was synced to Marketo. Marketo then handled the marketing activities for the lead. However there was no sync of marketing activities between Marketo and Dynamics CRM.

Therefore a sales person in Dynamics CRM was not aware of the marketing activities that were carried out of the lead in Marketo.


Marketo exposes Rest API’s which expose various information on the lead. We can use this API to retrieve lead activities. When a lead is synced between Dynamics CRM and Marketo, a lead id field is populated in Dynamics CRM. This is the unique reference field for the corresponding lead in Marketo.

Each call made to the Marketo API needs to be authenticated. Mentioned below are the fields that need to be maintained in Dynamics CRM what are required for authentication

  1. UserID – The userid configured should have API access privilege in Marketo.
  2. Password – The password of the corresponding UrserID.
  3. Marketo URL – Like Dynamics CRM exposes a discovery service for connecting to the organization, Marketo also exposes this url for account identification.
  4. Marketo Client Secret Key – A key that needs to be passed for authentication purpose.
  5. Marketo Client ID – A client id that needs to be passed for authentication purpose.
  6. Marketo Identity URL – Like Dynamics CRM exposes an Organization API, Marketo also exposes the API for various requests.

Pseudo code

  1. Using the authentication settings, we firstly need to find the access token

For doing so, make a REST Call to the mentioned below URL

Marketo Identity URL  + “/identity/oauth/token?grant_type=client_credentials&client_id=” + this.clientID + “&client_secret=” + this.client_secretID;

The result will be returned in JSON format. Deserialize the returned object and retrieve the value of access token.

  1. Now using the access token returned in the previous step, make a call to retrieve lead activities using the mentioned below REST Call

Marketo Identity URL  + “/rest/v1/leads.json?access_token=” + this.accessToken + “&filterType=leadid&filterValues=” + leadID(Synced field between Dynamics CRM and Marketo) + “&fields=id”;

The result will be returned in JSON format. The captured activities can then be shown in Dynamics CRM using a web resource or server side plugin.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s