Setting Up Conversion Tracking and Lead Capture

A conversion is any action a user takes that has value for your business, it can be anything from filling out a web-form to downloading a white-paper. With a simple setup, Oktopost not only allows you to track conversions that originate from social interactions but also attribute these conversions to actual contact details.

To get started, you will need to embed the tracking code on your website and create the various conversion types you want to track.

If you are familiar with it, there's also an easy way to set up Conversion Tracking through Google Tag Manager.

Installing the Tracking Code

The tracking code can be found under App Settings → Conversions → Tracking Code in your account. To embed it on your website, just copy and paste the code into every webpage you want to track just before the closing <HEAD> tag of the website template.


In case you are using WordPress you can also use the Oktopost Tracking Code plugin to install the code on your website.

About the code

  • The code is loaded asynchronously, so it won't slow down your site.
  • We automatically use https when appropriate.
  • The code can be used across multiple websites and subdomains.

Setting Up Conversion Types

Once the tracking code is placed on your website you can start creating the different types of conversions. There are two types that Oktopost allows you to track:

Type Description
Destination When a user reaches a specified webpage on your website e.g. /thankyou.html
Event When a user conducts a specified action, like viewing a video

To create a new conversion type, simply head over to Account SettingsConversions and create a new conversion type. For each type you will need to define:

  • Name: used to segment conversions in your account analytics.
  • Destination: used to determine when and how a conversion is triggered.
  • Value: used to assign a monetary value to the conversion.

To define a conversion that occurs when a user reaches a certain webpage, you can use one of the following destination types:

Type Description
Begins with Webpage URL begins with the specified value
Equals to Webpage URL equals to the specified value
Contains Webpage URL contains the specified value

Please note that your domain name should not be included in the destination value.

To define a conversion for events you will need to use the JavaScript API made available with the tracking code. This option is particularly useful when the action occurs without the user leaving the webpage or when the target URL cannot be described using the standard destination types.

In the following example, the JavaScript code snippet will send a new conversion to Oktopost with the name Example. If this conversion type is not already set up, Oktopost will create one automatically with the destination type set to None.

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

Capturing Lead Data

In most cases, conversions correlate to filling web-forms. The tracking code will always try to capture information users leave on your web-forms and sync it with Oktopost once a conversion is triggered, resulting in named conversions.

Lead data can also be sent programmatically along with the conversion type using the JavaScript API, for example:

_oktrk('send', {
	tag: 'Example',
	value: 100.00,
	firstName: 'John',
	lastName: 'Doe',
	email: '',
	company: 'IBM',
	country: 'US',
	state: 'NY',
	city: 'New York',
	zip: '123456'

Feedback and Knowledge Base