Last updated
These docs are intended for a developer audience.Dismiss

Lead source attribution

Lead source attribution is the process of giving credit to different marketing campaigns that contributed to the accomplishment of a specific goal (such as customer makes a purchase).

In the case of FramePay the attribution is done when the payment token is created from the collected customer data.

Automatic attribution

If the web address hosting FramePay contains Google Analytics UTM parameters then their value will be automatically collected.

There are five different UTM parameters, which may be used in any order:

UTM Parameter ExampleLead source parameter
utm_sourceutm_source=Googlesource
utm_mediumutm_medium=cpcmedium
utm_campaignutm_campaign=facebookcampaign
utm_termutm_term=red+shirtterm
utm_contentutm_content=bannerlinkcontent

FramePay parameters

In addition to the UTM parameters, FramePay will look for additional values to collect for the lead source data in the web address:

Lead source parameterExample
affiliateaffiliate=Acme
subAffiliatesubAffiliate=junior
clickIdclickId=btnSale
salesAgentsalesAgent=jdoe
Disabling automatic attribution

If the web address hosting FramePay contains UTM parameters but you do not want to collect that data you can provide an empty object to the extraData option when creating a token.

Example

Considering a checkout page hosting FramePay located at this web address:

https://www.example.com/checkout?utm_content=buynowlink&utm_medium=social&utm_source=facebook.com&utm_campaign=instantbuy&affiliate=gearbuy

The following lead source data would be gathered from the UTM and FramePay parameters:

{
    leadSource: {
        content: 'buynowlink',
        medium: 'social',
        source: 'facebook.com',
        campaign: 'instantbuy',
        affiliate: 'gearbuy'
    }
}

Manual attribution

If you want to provide additional information you must define the lead source object manually when creating the payment token.

var extraData = {
    leadSource: {
        content: 'buylink',
        medium: 'affiliate',
        source: 'affiliate-website.com',
        campaign: 'affiliate-campaign',
        affiliate: 'af12345'
    }
};
Framepay.createToken(form, extraData);

This method can also be used to prevent UTM parameter collection:

var extraData = {
    leadSource: {}
};
Framepay.createToken(form, extraData);

You can find a list of all accepted lead source parameters in the createToken documentation.