REST api to track events | Community
Skip to main content
November 25, 2015
Question

REST api to track events

  • November 25, 2015
  • 1 reply
  • 1706 views

Hi all - we want to replace our current munchkin events with REST api calls to send events to Marketo and trigger emails based on it. Can you please provide a

  • link to the documentation that describes how to do this a
  • provide a sample REST call

Here's a few examples of what we are doing now:

Tracks a page view:  events.trackMarketoEvent('paygo', 'userSetBillingInfo', 'pageView');

Trackes a button click: events.trackMarketoEvent('paygo', 'userSetBillingInfo', 'cancel');

Uses a URL to track success:  trackMarketoEvent("/account/create/success");

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Grégoire_Miche2
Level 10
November 25, 2015

HI Amanda Swan​,

There is no possibility to log standard Marketo Event through the REST API for the moment. You can only do this through the munchkin API.

You may also use custom events. In this case, you have the custom event table to be created by support and use this REST API call: Add Custom Activities » Marketo Developers

Warning : NEVER integrate a REST API call in a client side code. It will expose to the Internet your REST API access codes which in turn will expose your Marketo instance to DoS attacks.

-Greg

November 25, 2015

Why was this marked as the correct solution?

So you are telling me that if I want to track an "Account Create Success" to trigger a welcome email, I can't do that with a REST api call?

What is the best way to do the above?

My understanding was that Munchkin API was being deprecated

Grégoire_Miche2
Level 10
November 25, 2015

Hi Amanda Swan,

The munchkin API is not deprecated. It's a client side API, by opposition to Rest API that is a server side API. Both have their utility.

Typically, an "Account create Success" will have to be a custom activity, not a Marketo standard activity such as "fills out form", because you cannot create a "fills out form" activity in Marketo with the REST API and this is the API you want to use (This can only be done with the Munchkin).

So, to do this, as I wrote earlier, you need to have a custom "account creation" activity table created by support and, once this is done, you will be able to use the REST API to create such events in the DB.

You could also use a custom object (Marketo Custom Objects - Marketo Docs - Product Docs ) and then use another REST API (Marketo REST APIs: Custom Objects » Marketo Developer) to create customs object instances in the database. Unlike custom activities, custom objects creation does not require support help, you can do it on your own in minutes.

The difference between a custom activity and a custom object is that custom activities will show in the activity log, while the custom object will not, at least not explicitly. The custom object will appear more like the opportunities appear in Marketo. In order to log and leverage account creation in another system, I would probably use a custom objects, so that I could also store some account information, such as user preferences.

Both custom activities and custom objects will give you all the triggers and filters you need to send the welcome email.

-Greg