Conversion Tracking With Marketo Forms 2.0

Marketo Forms 2.0 allows you to create forms and embed them on any website or landing page. This functionality can also be extended by using a JavaScript API in order to improve user-experience.

One of the most common examples in which the JavaScript API can be used to improve the user experience is by hiding the web form and showing a thank-you message after a successful form submission, instead of redirecting the user to a thank-you page.

This short guide is meant for users with basic programming knowledge and provides an example on how to trigger Oktopost conversions programmatically using Marketo's JavaScript API.

Getting Started

To get started, you will need to make sure the Oktopost tracking code is available on the web page that the form is embedded on.

Once the code is embedded on the web page you're working on, you will have access to the _oktrk JavaScript API. Generally, in order to trigger an Oktopost conversion with JavaScript you would have to trigger the following code:

_oktrk('send', { 
	tag: 'TAG_NAME'

This code will create a conversion in Oktopost, assuming that the user had previously clicked on an link. The TAG_NAME can be replaced according to the conversion type you wish to track e.g. Download, Signup etc.

Putting It All Together

To use the code above with Marketo Forms 2.0 JavaScript API you will need to make sure the web form is submitted first using the onSuccess() callback.

By triggering the conversion following a form submission you're enabling Oktopost to capture the lead information entered within the form and associate it with the conversion. Here's a full example:

<script src="//"></script>
<form id="mktoForm_1001"></form>
MktoForms2.loadForm("//", "000-XXX-000", 1001, function (form) {
	form.onSuccess(function (values, followUpUrl) {
		_oktrk('send', { 
			tag: 'TAG_NAME'

		return false;

Note that if the conversion code is used without a prior form submission it would result in anonymous conversions in your Oktopost account.


  1. How to Set Up The Marketo Integration
  2. How to Install Social Insights for Salesforce
  3. Salesforce Social Insights Data and Reports
  4. How to Install Social Analytics for Salesforce
  5. How to Install Social Advocacy For Salesforce
  6. How to Set Up The Eloqua Integration
  7. How to Set Up the HubSpot Integration
  8. How to Set Up The Salesforce Integration
  9. How to Set up The Microsoft Dynamics Integration
  10. Microsoft Dynamics Social Activity Entity
  11. Oktopost Solution Package for Microsoft Dynamics
  12. How to Set Up The Mautic Integration
  13. How to Set Up the Bitly Integration
  14. How to Set Up the Feedly Integration
  15. How to Set Up the Act-On Integration
  16. Feedly Custom Sharing with Oktopost
  17. Act-On Integration: Segmenting Lists Using Social Data
  18. Act-On Integration: Social Lead Scoring
  19. Conversion Tracking With Marketo Forms 2.0
  20. Marketo Integration: Lead Segmentation
  21. Marketo Integration: Interesting Social Moments
  22. How to Set Up the Salesfusion Integration
  23. How to Set Up the Pardot Integration
  24. Setting up the Google Analytics integration
  25. How to Set Up the Facebook Retargeting Integration
  26. How to Create a Facebook Audience Based on Social Behavior
  27. Attributing Social to Leads in Marketo
  28. Webhooks
  29. How to Connect Oktopost to Zapier
  30. How to Create Salesforce Cases From Assignments
  31. Setting up Integration Assets
  32. Social Click URLs
  33. Salesforce Campaign Naming Parameters
  34. How to Track Conversion on HubSpot Embedded Forms
  35. How to Track Conversion on Pardot Forms
  36. How to Track Conversions on Act-On Labs Forms
  37. How to Set Up Single Sign-on With AD FS
  38. How to Set Up Single Sign-on With Okta
  39. How to Set Up Single Sign-on With OneLogin
  40. How to Set Up Single Sign-on With Google Apps
  41. How to Set up Single Sign-on With Azure Active Directory (AAD)
  42. How to Set Up The Facebook Lead Ads Integration
  43. Zapier Use Cases
  44. How to Set up Oktopost for Bizible
  45. How to Format Dates in Salesforce Template Fields
  46. Social Attribution Parameters
  47. Lead Parameters
  48. How to Update an Existing Social Insights Installation

Feedback and Knowledge Base