@grouparoo/marketo

Last Updated: 2021-09-01

Grouparoo's Marketo plugin enables you to export contacts and tags to Marketo.

This guide will show you how to work with the Marketo plugin to create a Destination to export your data.

Install the Marketo Plugin

To work with the Marketo plugin, you must first install it in an existing Grouparoo project. You can do this using the install command from our CLI:

$ grouparoo install @grouparoo/marketo

This adds the package to your package.json file as a dependency, and also drops the plugin in the grouparoo.plugins section in that same file, which enables it.

// package.json
{
// ...
"dependencies": {
"@grouparoo/marketo": "...",
// ...
},
"grouparoo": {
"plugins": [
"@grouparoo/marketo",
// ...
]
}
}

Once the plugin is installed, you'll be working primarily with the CLI's configuration commands to get everything set up.

Create a Marketo App

With Grouparoo, an App is how we establish a connection with a source or destination. Add this connection by generating an App:

$ grouparoo generate marketo:app my_marketo_app

This will generate a file at config/apps/my_marketo_app.js. Open this file and edit the connection details to match your desired configuration. Here is an example of what this config object will look like after generation:

// config/apps/my_marketo_app.js
exports.default = async function buildConfig() {
return [
{
class: "app",
id: "my_marketo_app",
name: "my_marketo_app",
type: "marketo",
options: {
}
},
];
};

Validating & Applying Your Config

You can validate your config at any time using the validate command:

$ grouparoo validate

And you can apply that config (save it to your Grouparoo application's database) using the apply command:

$ grouparoo apply

Create an Marketo Destination

Once your App exists, you can generate an Marketo Destination using the generate command. You must specify a parent, which should match the id of the App you just created.

This is the simplest form of Generator for Destinations:

$ grouparoo generate marketo:destination marketo_destination --parent my_marketo_app

This would generate a config file at config/destinations/marketo_destination.js in your Grouparoo project. You can then edit this file to match your desired configuration. Here is an example of what this config object will look like after generation:

// config/destinations/marketo_destination.js

exports.default = async function buildConfig() {
  return [
    {
      id: "marketo_destination",
      name: "marketo_destination",
      class: "destination",
      type: "marketo-export",
      appId: "my_marketo_app",
      groupId: "...",
      syncMode: "...",

      mapping: {
        email: "email",
        firstname: "firstName",
        lastname: "lastName",
      },

      destinationGroupMemberships: {
        "High Value Customers": "highValueCustomers",
      },
    },
  ];
};

For more information on what all these properties mean and how to configure them, see Configuring your Destination.

Sync Modes

The Marketo Destination supports all three sync modes:

  • Sync (sync): Add, update, and remove profiles as needed.
  • Additive (additive): Add and update profiles as needed, but do not remove anybody.
  • Enrich (enrich): Only update profiles that already exist in the Destination. Do not add or remove anybody.

You can set the desired sync mode through the syncMode property in the config file:

syncMode: "additive",

Property Mappings

These mappings are what tell Grouparoo which Properties you want to sync to the Destination and what they should be called. For this plugin, Grouparoo Properties map to Marketo Leads Fields.

For Marketo, mapping the email property is always required.

You can also map to custom attributes that you've defined on Marketo by simply adding them along with the others.

Here's an example of how this would look in the config file. Note that the keys refer to Marketo Attribute names and values refer to Grouparoo Property IDs.

mapping: {
  email: "email",
  firstname: "firstName",
  custom_lifetime_value: "ltv",
},

Group Mappings

You can use Group Memberships to automatically add Marketo Tags to your contacts.

Here's an example of how to configure this in the config file. Keys refer to the name of the tag to be shown on Marketo and values refer to the Grouparoo Group ID.

destinationGroupMemberships: {
  "High Value Customers": "highValueCustomers",
},

Marketo Next Steps

Once you have the plugin installed, App created, and a Source or Destination configured, you are ready to validate, apply, then import or export your data!