What is Marketo?
Like Mircosoft Dynamics Marketing, Marketo is a Marketing automation software which provides solutions related to
- Lead Management
- Sales Insight
- Revenue Cycle Analytics
- Social Marketing
It provides connectors which integrate the Lead, Contact between Dynamics CRM and Marketo.
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
- UserID – The userid configured should have API access privilege in Marketo.
- Password – The password of the corresponding UrserID.
- Marketo URL – Like Dynamics CRM exposes a discovery service for connecting to the organization, Marketo also exposes this url for account identification.
- Marketo Client Secret Key – A key that needs to be passed for authentication purpose.
- Marketo Client ID – A client id that needs to be passed for authentication purpose.
- Marketo Identity URL – Like Dynamics CRM exposes an Organization API, Marketo also exposes the API for various requests.
- 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.
- 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.