Marketo integation with CRMs ERPs

Marketo integration with major CRM and ERP systems

Georgii KapanadzeConnectors Leave a Comment

In today’s blog I would like to present a way how to synchronize Marketo with major CRMs  and ERPs like Dynamics CRM, Salesforce, SugarCRM, Dynamics AX, NAV. The benefits of integrating Marketo and other business systems have been discussed in our previous blog. I will demonstrate the synchronization using a showcase between two different target systems (Marketo and Dynamics CRM) with the use of simple SQL statements. For this purpose I will be using Connect Bridge and its Marketo and Dynamics CRM connectors.

Why to use Connect Bridge?

Usually in order to be able to communicate with 2 different target systems, in our case a MS Dynamics CRM server and Marketo, the developer would need to know the API of each target system. This requires some studying of the API in order to understand how they work and how to write the source code in order to be able to do the same process that we are going to demonstrate later in this blog.

With the use of Connect Bridge and its Marketo and CRM connectors, the time necessary to understand and to be able to successfully implement the solution is significantly reduced. The main difference is that Connect Bridge allows the developer to use simple SQL statements to communicate with each target system. This is not possible when using the API of the target system itself because of different schemas and architectures used to develop the target system. Connect Bridge also allows connection to multiple target systems at the same time by using the available connectors. For more information about Connect Bridge visit the web page.

What do we need?

Firstly we will need credentials to connect to MS Dynamics CRM and Marketo. As we are going to be using Connect Bridge, we will need a running Connect Bridge server with CRM and Marketo connectors.

For our demonstration, let’s assume that accounts for Marketo and Dynamics CRM were already created in the Connect Bridge server. The user credentials for each target system are used during the setup of each account so the Connect Bridge knows what credential to use when communicating with the target system (Dynamics CRM credentials for communication with Dynamics CRM and Marketo credentials for communication with Marketo).

For demo purposes we will use Visual studio, where we create a simple console application that will do the synchronization.

We are going to use Connect Bridge query analyzer tool to demonstrate the SQL statements and the output that is returned by the Connect Bridge server.

The solution

The console application

First we need to create new console application where we do our coding. Go to File – New – Project and choose a console application.

console application

The next step is to add a service reference to our Connect Bridge server. Right click on References and add a service reference.

Connect Bridge

Type the address where the Connect Bridge server is listening and type the name of the Service namespace to “CB”.

Connect Bridge

After adding a reference to the Connect Bridge server service, we can start writing our code.
First we prepare our credentials and account names that will be used during the synchronization to authenticate with the Connect Bridge server.

public static string userName = "administrator";
public static string password = "1234";
public static string CRMAccountName = "CRMConnector";
public static string MarketoAccountName = "MarketoConnector";

In the body of the main application, write the following lines of code that will take care of creating a connection to the target systems and do the synchronization.

WsDriverClient MarketoClient = new CB.WsDriverClient("CBWsBasicBinding_IWsDriver");
WsConnection MarketoConnection = MarketoClient.CreateConnection(userName, password, MarketoAccountName, null);

WsDriverClient CRMClient = new CB.WsDriverClient("CBWsBasicBinding_IWsDriver");
WsConnection CRMConnection = CRMClient.CreateConnection(userName, password, CRMAccountName, null);

string selectSQL = "select priority, relativeScore, urgency, email, firstName, lastName from Lead;";

WsResultSet resultMarketoLeadSelect = MarketoClient.Execute(MarketoConnection, new WsStatement() { SqlStatement = selectSQL });

if (resultMarketoLeadSelect.IsSuccess)
{
 //process returned rows
 foreach (var row in resultMarketoLeadSelect.Row)
 {
 string insertSql = string.Format("insert into Lead(firstName, lastName, emailaddress1) values ('{0}','{1}','{2}')", row[4], row[5], row[3]);
 var result = CRMClient.Execute(CRMConnection, new WsStatement() { SqlStatement = insertSql });
 }
}

After you type in the code above, we are ready to do the synchronization. To explain what the code does, there are 3 main parts.
First part is the MarketoClient and MarketoConnection. This code takes care about the connection and execution of statements against the MarketoConnector and therefore Marketo target system.
Second part is the CRMClient and CRMConnection. This code takes care about the connection and execution of statements against the CRMConnector and therefore Microsoft Dynamics CRM system.
The third part of the code is the synchronization process. We create a select statement that is executed using the Marketo Connector go get the data about the leads that we want to synchronize. Then we iterate through the returned data and execute an insert statement for each record to insert the lead into the Dynamics CRM. For the demo purposes I take only email, firstName and lastName columns from Marketo and synchronize these columns into Dynamics CRM.

The synchronization

As you can see from the screenshots below, in Marketo we have 10 leads that we want to synchronize to Dynamics CRM.
To display the leads using the Query Analyzer tool, select the Marketo connection, put the following sql statement and execute the query.
select priority, relativeScore, urgency, email, firstName, lastName from Lead;

Connect Bridge

After checking the leads that we want to synchronize, run the console application that we created in the previous chapter. The application will take care of the synchronization.
After executing the console application we can check whether the leads were synchronized using the query analyzer tool and the GUI as well.
To check the results with the query analyzer tool, select the CRM connection and run the following SQL statement.
select leadid, emailaddress1, firstName, lastName, createdon from Lead order by createdon desc limit 10;

Connect Bridge

From the screenshots above you can see that our synchronization was successful and now we have leads from Marketo synchronized in MS Dynamics CRM.

Summary

From this short demonstration you can see how fast the data can be accessed with minimum effort. That way, Marketo can be integrated not only with major CRMs and ERPs, but also with CMS, DMS and email. Full control over the integration process is up to a developer and they decide which entities and how to be synchronized. The developer can use any kind of coding language and use ODBC, JDBC or web services to communicate with Connect Bridge server. The simple use of SQL statements across multiple target systems makes the development process more efficient and faster than using direct APIs of the target systems. A skilled developer can create various synchronization scripts for different target systems and develop powerful cross target system synchronization tools.

We will be glad to hear from you. Contact us and find out how to easily integrate Marketo into your company’s system landscape.

Leave a Reply

Your email address will not be published. Required fields are marked *

For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.