How to Connect Segment and Marketo

Usha Vadapalli
February 28, 2023

Segment is a leader in product/user event tracking.Segment it’s favored by product-led growth (PLG) companies large, SMB, and early-stage alike given it’s robustness and the amount of connections available to action on the data

Marketo is a highly-rated marketing automation platform among large enterprises. It is well-known for its ability to manage workflows and organize complex logic in areas such as email nurturing, customer segmentation, and lead management.

The purpose of integrating Marketo with Segment and Marketo is to seamlessly transfer customer data to Marketo in real-time to power marketing automation with the right data.

This blog post explains how to establish a connection between Segment and Marketo in detail.

Connecting Segment and Marketo

Before starting the integration process:

  • Log in to the Marketo admin account.
  • Enter Marketo credentials into the Destination settings.
  • To get the Marketo Munchkin Account ID:
  • Go to Admin in the top right corner, and click Munchkin on the left bar.

To get your Client Secret and Client ID, you must create a role that has full API access, an API only user, and then create a Service in Marketo.

To create a role that has full API access:

  • Go to Admin in the top right corner, and click Users & Roles on the left.
  • Click on the Roles tab.
  • Click New Role.
  • Name your role and check the API Access box to assign the user full API access and click Create.

After creating an API role, you have to assign that role to an API Only user:

  • Go to the Users tab and select Invite New User.
  • Fill out the required fields in Step 1.
  • Assign the new role you created to this user in Step 2.
  • Select the API Only box.
  • Click Next and then Send.

To create a Service and get Client Secret and Client ID from it:

  • Go to LaunchPoint on the left and click New.
  • Select New Service from the drop-down and choose Custom.
  • Select the new API Only user you invited.

Note: This user must be an API Only user and be assigned a role that has full API access.

  • Select View Details on the new service just created.
  • A pop-up window displays the Client Secret and Client ID. Copy and paste them into the Destination’s Settings.

Finally, to create a User ID and an Anonymous ID field in Marketo:

  • Go to Admin and click Field Management on the left
  • Select New Custom Field.
  • Choose the type String, and name the field.
  • Set the API name to userId for the user ID field and then anonymousId for the anonymous ID field.

Note: The destination will not work if API names other than userId and anonymousId are used.

Segment uses 6 API calls, each representing a specific type of customer info. Let’s look at the ones required for this integration.

Identify

Important: To relay data from Segment to the destination, a.k.a Marketo, choose Cloud Mode. In Device Mode, the tracked data is directly sent to the destination. Select the mode of connection depending on the requirements.

In the Cloud Mode, Segment uses Marketo’s REST API to create and update leads on the server side when you call Identify. Whereas In the Device Mode, it uses Marketo’s Background Form Submission to do the same on the client-side.

Additional steps to send .identify( ) calls in Device Mode:

  • Generate an empty form in Marketo, which will remain hidden and doesn't require any data to be filled as long as the necessary traits are mapped in the Marketo Custom Fields Destination setting.
  • Enter the relevant Marketo Form ID and URL in your Marketo V2 Destination settings, which can be located in the Embed Code section under Form Actions in the Marketo Design Studio.

Traits

Regardless of the connection mode, map the specified Segment traits to Marketo's standard fields

Here is an example showing JavaScript Identify call with all the standard traits:

analytics.identify('1234', {

 firstName: 'Robyn Rihanna',

 lastName: 'Fenty',

 email: 'rihanna@example.com',

 gender: 'woman',

 phone: '555-555-5555',

 company: 'Segment.com',

 birthday: '1988-02-20T00:00:00.000Z',

 createdAt: '2007-05-31T00:00:00.000Z',

 address: {

   city: "Eugene",

   country: "USA",

   postalCode: "97405",

   state: "Oregon"

 }

});

Note: To send any additional traits from .identify( ) call to update a field in Marketo, create custom fields in Marketo and map them in the Marketo Custom Fields Destination setting.

Refer to the documentation for more information on mapping custom activities and fields.

Track

Any user action and the properties that describe the action are recorded by the track API call.

When you perform a Track call in Segment, it maps the event to a Marketo Custom Activity that has been pre-defined. To ensure successful tracking to Marketo:

  1. Map track calls to your Marketo Custom Activities in your Destination Settings to avoid missing events
  1. Either enable Cloud Mode or Device Mode with the Send Track Events Server Side setting enabled. Send track events through one of Segment's server side libraries. This helps limit the number of API calls made to Marketo. For example:

Analytics.track(

 event: 'Segment Event',

 properties: {

   firstName: 'Alex'

 }

)

In this section,

  • To get the Marketo Activity ID, go to Marketo Custom Activities, click on Marketo Activity  you need to map to the Segment Track event, and copy + paste the ID into the Destination Settings.
  • Segment Property Name is the name of the property in the .track( ) call. This  has to exactly match the property passing it in the .track( ) call.
  • Marketo Field Name is the name of the Marketo Attribute for your Custom Activity. You can locate the attribute names for a specific Custom Activity in the Fields tab of Marketo Custom Attributes. To view the attributes for a Custom Activity, follow these steps:

    1. Click on the Custom Activity on the right-side.

    2. A list of your attributes for that Custom Activity will be displayed.

    3. Make sure to precisely copy and paste the API Name for the field as it appears in Marketo. Note that the API Name is case-sensitive.
  • Marketo Field Type refers to the type of the Marketo Attribute. You can find the type of attribute in the Fields tab of Marketo Custom Attributes. To view the attributes for a Custom Activity, simply click on it in the right-side bar and a list of your attributes for that activity will be displayed.
  • Primary Field refers to a field that has been designated as the main field when creating a Custom Activity in Marketo. If you are uncertain which field was set as the primary field, you can easily identify it in the list of fields for your Custom Activity in Marketo by looking for a red star next to it.

Page

The Page API call records the users’ activity when they visit the pages on your website and other optional properties about the page.

Segment follows the Marketo's Munchkin.js visitWebPage process whenever a Page call is used. This process requires the URL (built from your .page( ) event and properties objects) and a user agent (automatically collected Client-side, but not server side). Note that the calls missing either of these fields are not sent to Marketo.

An example of Node .page( ) event:

   analytics.page({

     userId: '019mr8mf4r',

     category: 'Docs',

     name: 'Node.js Library',

     properties: {

       url: '/docs/connections/sources/catalog/libraries/server/node',

       path: '/docs/connections/sources/catalog/libraries/server/node/',

       title: 'Node.js Library - Segment',

       referrer: 'https://github.com/segmentio/analytics-node'

     },

     context: {

       userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36"

     }

   });

For more information on setting up, migrating from Marketo v1 (legacy) to V2, and troubleshooting Segment to Marketo integration, refer to the documentation.

Before Connecting Segment and Marketo

The goal behind connecting Segment and a marketing automation destination like Marketo is to seamlessly flow actionable data into the platform to trigger contextual communication with personalized content.

But the limitations of this sync that is not made for PLG companies would cost a bomb, limit or duplicate the data fields synced hurting the very reason behind the integration.

Marketo’s API Call Limits and Pricing

Marketo's pricing tiers have an upper threshold on API calls and the number of custom objects/data fields for each tier. Their most expensive plan allows only 50K API calls per day and 10 custom objects to be created.

Product-led businesses typically see massive product activity event volume every day. We are talking of millions of small and big data events. When syncing data from Segment, custom data fields have to be created on the Marketo side to accommodate all this information, which means extra $$ in billing.

It’s the same case with API calls. A user can carefully choose and limit the API calls but, this action will limit the real-time use cases to drive growth through product-led campaigns.

Duplication

Restricting the API calls also has another disadvantage.

When the data is synced in batches and doesn’t freely flow, Segment’s identify calls are not processed in real-time. If the clogged data has duplicates, essentially they are not flagged and this creates duplicate records in Marketo.

Marketo customers end up paying a lot more than the plan’s original price when the duplicates pile up.

There are some workarounds for these issues like hiring a Marketo expert for implementation assistance or a third-party tool like Stitch or Tray to smoothen data flow but they come at a cost and their own dependencies and complications.

Lacking Personalization

So, all the above limitations add up to create one major issue. The lack of personalization.

If a Marketo user is importing select product and customer data, that means the campaign is not tailored to your customers.

Sending a generic ‘Upgrade Now’ email to lean teams in small and teams from large enterprises using multiple workspaces in your product  is not going to work!

Segment and Inflection for PLG

Inflection.io is the better alternative for product-led growth companies to build and launch personalized PLG campaigns with data powered by Segment or directly with your data warehouse.

Inflection combines product activity and CRM (like Salesforce) data to give you a unified view of your customer. Our out-of-the-box integration with Segment helps you build and mobilize your growth automation at scale without compromising on personalization.

We are conscious of the product activity event volume typical for a PLG company. Inflection’s transparent and PLG-friendly ensures that you pay for what you use and scale as you grow without costing an arm and a leg.

To find out more about Inflection and see the product in action, get started here.

Get monthly blog roundup

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.