Tech docs
Integration Docs
Conversion Tracking

Conversion Tracking

This feature is currently in beta, so instructions may be subject to change. If you'd like to apply for the pilot program, fill out the interest form or contact your account manager.

Take care when configuring conversion events - once they're sent, they'll appear in the dashboard, and there's no easy way to remove that data. We recommend implementing on a testing site first.

#Categories of conversion events currently supports five categories of conversion events, plus custom events:

  1. Lead Capture - When a user provides identifying details (e.g. email, name) via a form to indicate they have interest in what the company is selling (i.e. a lead). See example code.
  2. Link Click - When a user clicks a link or button (e.g. an internal link or affiliate link). See example code.
  3. Newsletter Signup - When a user provides their email via a form in order to receive emails from a company, such as a newsletter or an email course. See example code.
  4. Subscription - When a user buys a subscription that will result in recurring revenue. See example code.
  5. Purchase - When a user completes the one-time purchase of a product. See example code.
  6. Custom - When a user completes an action not covered by the five standard events. See example code.

In the future, may provide benchmark comparisons of the standard categories of events (e.g. comparing how your newsletter signup performance compares to rest of the network). For this reason, we discourage using custom events except when absolutely necessary.

#Sending a conversion event

When a conversion event is triggered, call PARSELY.conversions.<relevant function name> to send the data to's servers. Each function takes one parameter, which is a descriptive label for the conversion event. Labels may appear in the dashboard, so spaces and capitalization are supported.

PARSELY.conversions.trackLeadCapture('Demo Request');
labelstringnoA string specific to a particular implementation

Note that the PARSELY.conversions.<track functions> functions are available only after the tracker code has finished loading. To capture conversion events that may occur before the tracker loads, continue to the next section.

#Deprecation Notice

If you were an early participant in the Conversions Beta, the previous JavaScript API function, PARSELY.beacon.trackConversion, is now deprecated. Please transition your code to the new API, which is outlined here. The previous version will remain available on your tracker while you make the transition.

#Handling conversions whenever they occur

Because it's possible for a conversion event to happen before the tracker has fully loaded, it's recommended to use a wrapper function (captureParselyLeadConversion in the example below), rather than calling a method which may not yet exist. Using the example of a lead capture from above, you might have something like this on a lead-gen page:

// make a queue for conversion events
var parselyConversionEventQueue = [];

// wrapper function safely handles either case
function captureParselyLeadConversion(label) {
    if (window.PARSELY && window.PARSELY.loaded) {
    } else {

// run this safely whenever you capture an event
captureParselyLeadConversion('Demo Request');

// flush the queue when the tracker loads
window.PARSELY = window.PARSELY || {
    onload: function() {
        for (var i = 0; i < parselyConversionEventQueue.length; i++) {

// insert the parsely tracker code here...


Any code that sets PARSELY.onload (such as the example above) must be executed before the loading tracker.

#Sample Implementations

The following examples are necessarily simplified for illustration purposes, and are not meant to be used as-is.

#Lead Capture conversion example

Use trackLeadCapture when a user provides identifying details (e.g. email, name) via a form to indicate they have interest in what the company is selling.

Some examples include:

  • Signing up for a demo
  • Creating an account to start a 30-day trial
  • Signing up for a rewards program

In this example, generated leads are also distinguished by their "active" status.

// listen for submit events on a form, to indicate a lead capture
var form = document.getElementById('demo-request-form');
form.addEventListener('submit', PARSELY.conversions.trackLeadCapture('Demo Request'), false);

// Alternately, you might want to distinguish leads who were already active users...
function trackParselyLead(e) {
    // determine if the user is active based on the session count
    var userSessionCount = PARSELY.lastRequest.sid;
    var userStatus = userSessionCount > 5 ? "active" : "new";
form.addEventListener('submit', trackParselyLead, false);

#Newsletter signup conversion example

Use trackNewsletterSignup when a user submits their email address via a form to subscribe to a newsletter or other email program.

// listen for click events on a button which indicates a newsletter signup
var btn = document.getElementById('newsletter-signup-button');
btn.addEventListener('click', PARSELY.conversions.trackNewsletterSignup('Politics Newsletter Sign Up'), false);

#Subscription conversion example

Use trackSubscription when a user buys a subscription product that will result in recurring revenue. (For one-time purchases, use trackPurchase.)

Some examples include:

  • a software subscription
  • a monthly/weekly subscription box
  • a content subscription (e.g. for a streaming service, a newspaper)
  • a recurring donation

Here, a monthly subscription to a beauty box is tracked.

var form = document.getElementById('glam-box-subscribe');
form.addEventListener('submit', PARSELY.conversions.trackSubscription('Glam Box Monthly Subscription'), false);

#Purchase conversion example

Use trackPurchase when a user makes a one-time purchase of a product. (For purchases that result in recurring revenue, use trackSubscription.)

Some examples include:

  • buying a ticket to an event
  • buying a pair of shoes
  • making a one-time donation

Instead of a monthly subscription, this example tracks a one-time purchase of a pair of shoes.

var form = document.getElementById('men-sneaker-id-5436-purchase');
form.addEventListener('submit', PARSELY.conversions.trackPurchase("Men's Sneaker Id 5436"), false);

Use trackLinkClick when a user clicks a link (in-line, button, banner, etc).

Some examples include:

  • when a user clicks a call-to-action (such as a Subscribe button or a product recommendation). This can indicate intent, even if the user doesn’t complete the intended action (e.g. clicking a Subscribe button, but not completing payment for the subscription).
  • when a user clicks an affiliate link
  • when a user clicks from a blog post to landing page
  • when a user clicks a social share button

In this example, sometimes we want to send a generic label when the link matches some domain; otherwise, we might want to track the entire link itself.

var ecomDomain = "";
function parselyLinkClickConversionCallback(e) {
    if ( === 'A'
        && !== -1
    ) {
        // Can inspect the events to send custom labels
        // for specific events...
        PARSELY.conversions.trackLinkClick('E-commerce Link Click');
    } else {
        // ... or simply send the link that was clicked.
document.addEventListener('click', parselyLinkClickConversionCallback, false);

#Custom conversion example

Use trackCustom when a user completes an event that is not covered by the five standard categories above.

Some examples include:

  • when a user lands on an important page
  • when a user comments on content

#Note about Custom Events and Benchmarking

Because Custom events are not standardized, will not be able to benchmark these events and give you insight on how your performance compares to’s network as a whole. For this reason, we discourage the use of custom events unless absolutely necessary.

Here are some examples that might not fit into the above categories:

// capture interactions with an online voting widget, for example...
var ballot = document.getElementById('vote-box');
function trackUserVote(e) {
    // use event metadata to determine which option they voted for
    var vote = "voting-choice";
ballot.addEventListener('click', trackUserVote, true);

// Perhaps you would like to see which content influences
// users to get farthest into a survey or form...
var formFields = document.getElementsByTagName('input');
function userAttemptsField(e) {
    // only send events when users try to fill in certain fields
    if ("goal-input-field") < 0) {
        return false;
    var fieldname =;
    PARSELY.conversions.trackCustom('form-123-focus-' + fieldname);
for (i = 0; i < formFields.length; i++) {
    formFields[i].addEventListener('focus', userAttemptsField);
rocket emoji