---
schema_version: "1"
id: 88efb7e65ada60e9e3c6f1802490248a787d34a43ef3b2262e585ab17e9f6a83
title: AgentExchange Lead Sources
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/isvforce/guides/appexchange-lead-source-codes.md
canonical_url: https://developer.salesforce.com/docs/platform/isvforce/guide/appexchange-lead-source-codes.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 834265e1668092f136c72c04b2f4c48468b2202e1f274c24ed267104db2dbadd
products:
  - ISVforce Guide
  - merged-docs
---

# AgentExchange Lead Sources

AgentExchange leads include details to help you understand the source—that is, where and how the lead originated. The lead source code identifies the action that the customer performed to generate the lead, such as watching a demo video. The lead source description provides information about how the customer discovered your listing, such as a third-party marketing campaign.

## Lead Source Codes

The Lead Source field stores lead source codes in this format: `SFDC-XX|Listing Name` or `SFDC-dup-XX|Listing Name`. `XX` identifies the action that the customer performed to generate the lead.

This table lists source codes.

| Source Code | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DM`        | The user clicks the demo video tile in the media carousel of your listing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `IN`        | This code is applied when a user takes one of these actions. <ul><li>The user clicks **Get It Now** on your listing and starts the production installation process for your solution.</li><li>The user clicks **Try It** on your listing and starts the sandbox installation process for your solution.</li></ul> Sometimes users don’t complete the installation, or they uninstall your solution later. To track package installations, use the [License Management App (LMA)](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/lma_intro.htm). |
| `LM`        | The user clicks **Learn More** on your listing. Listings that previously had Learn More buttons now have Get It Now buttons and receive lead source codes with IN actions.                                                                                                                                                                                                                                                                                                                                                                                                            |
| `OR_NONUS`  | A user clicks **Request Private Offer** and selects outside the United States as their country.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `OR_US`     | A user clicks **Request Private Offer** and selects the United States as their country.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `TD`        | The user clicks **Try It** on your listing and starts a test drive of your solution.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `TS`        | This code is applied when a user takes one of these actions. <ul><li>The user clicks **Get It Now** on your listing and starts a 30-day trial of Salesforce and your solution.</li><li>The user clicks **Try It** on your listing and starts a Trialforce trial.</li></ul>                                                                                                                                                                                                                                                                                                            |

## Lead Source Description

The lead source description indicates how a customer discovered your listing and, if applicable, their contact preferences about other products or services that you offer. Lead source descriptions vary based on how you market your listing, but can include:

- Urchin Tracking Module (UTM) parameters from marketing campaigns.
- Codes from referral programs.
- External traffic sources, such as Google searches.
- Internal traffic sources, such as AgentExchange searches.

**note:** UTM, referral code, and traffic source details are available for AgentExchange solution listings. For consultant listings, the lead source description includes only a customer’s contact preference in text format.

The Description field stores these details in JSON format:

```javascript
{
  "lead_description": {
    "allow_contact_other_products": true,
    "listing_url": "example-URL",
    "offer_request_details": "example-details",
    "utm_parameters": {
      "utm_campaign": "example-campaign",
      "utm_content": "example-content",
      "utm_medium": "example-medium",
      "utm_source": "example-source",
      "utm_term": "example-term"
    },
    "referral_code": "example-code"
  }
}
```

If UTM or referral code details aren’t available, AgentExchange omits them and populates an `other_source` property from a standard list of internal and external traffic sources:

```javascript
{
  "lead_description": {
    "allow_contact_other_products": true,
    "listing_url": "example-URL",
    "other_source": "example-traffic-source"
  }
}
```

To receive UTM or referral code details in your lead source description, configure a referrer URL as follows:

`https://appexchange.salesforce.com/appxListingDetail?listingId=a0NXXXXXXXXXXXXXXX &utm_campaign=example-campaign&utm_content=example-content&utm_medium=example-medium &utm_source=example-source&utm_term=example-term&referral_code=example-code`

Where _a0NXXXXXXXXXXXXXXX_ is your listing ID.

**tip:** To configure a referrer URL that contains only UTM parameters, consider Google’s [Campaign URL Builder](https://ga-dev-tools.google/campaign-url-builder/).

This table lists lead source description properties.

| Property                       | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `allow_contact_other_products` | Boolean | The customer’s contact preference regarding marketing communications for other products and services that you offer. If you don’t offer products or services outside of the listing where the lead originated, ignore this property. Examples:<ul><li>`true`–The customer consents to marketing communications related to other products and services that you offer.</li><li>`false`–The customer doesn’t consent to marketing communications related to other products and services that you offer.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `listing_url`                  | String  | The URL of the listing where the lead was generated, without the UTM parameters, referral codes, and traffic source details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `other_source`                 | String  | The source that referred traffic to your listing if UTM parameters or referral codes aren’t provided. This property is set by AgentExchange. The default value is `Web`.Examples:<ul><li>`AppExchange Browse`–Traffic referred by the AgentExchange home page or from areas of the marketplace not included in other sources.</li><li>`AppExchange Explore`–Traffic referred by an AgentExchange Explore page.</li><li>`AppExchange Recommended`–Traffic referred by a personalized recommendation on AgentExchange.</li><li>`AppExchange Search`–Traffic referred by an AgentExchange search results page.</li><li>`AppExchange Sponsored Explore`–Traffic referred by the Sponsored Solutions section on an Explore page.</li><li>`AppExchange Sponsored Search`–Traffic referred by the Sponsored Solutions section on a search results page.</li><li>`Facebook`–Traffic referred by a Facebook page or ad.</li><li>`Google`–Traffic referred by a Google search or ad.</li><li>`Web`–Traffic referred by any web source that isn’t affiliated with Facebook or Google.</li></ul> |
| `referral_code`                | String  | A unique identifier associated with the content or campaign, such as a discount code. To populate this property, include one of these parameters in the referrer URL:<ul><li>`ref`</li><li>`referral`</li></ul>Example: `ref=astro25off`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `utm_campaign`                 | String  | The promotional or marketing campaign that referred traffic to your listing. To populate this property, include the `utm_campaign` parameter in the referrer URL. Example: `utm_campaign=appy-dreamforce`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `utm_content`                  | String  | The content zone or variant that referred traffic to your listing, such as a banner that uses a specific call to action or image. To populate this property, include the `utm_content` parameter in the referrer URL. Example: `utm_content=cta-header-1`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `utm_medium`                   | String  | The medium that referred traffic to your listing, such as cost per click. To populate this property, include the `utm_medium` parameter in the referrer URL. Example: `utm_medium=cpc`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `utm_source`                   | String  | The source that referred traffic to your listing, such as a newsletter. To populate this property, include the `utm_source` parameter in the referrer URL. This property is required to use other UTM parameters. Example: `utm_source=newsletter`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `utm_term`                     | String  | The keyword or phrase that referred traffic to your listing. To populate this property, include the `utm_term` parameter in the referrer URL. Example: `utm_term=sales+productivity`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

## Example

This example shows a sample referrer URL and the related JSON block. In this example, we assume that the customer agrees to marketing communications. For this sample URL:

`https://appexchange.salesforce.com/appxListingDetail?listingId=a0NXXXXXXXXXXXXXXX &utm_campaign=spring&utm_medium=organic_social&utm_source=newsletter`

This JSON block appears in the Description field of the lead:

```javascript
{
  "lead_description": {
    "allow_contact_other_products": true,
    "listing_url": "https://appexchange.salesforce.com/appxListingDetail?listingId=a0NXXXXXXXXXXXXXXX",
      "utm_parameters": {
        "utm_campaign": "spring",
        "utm_medium": "organic_social",
        "utm_source": "newsletter"
      }
  }
}
```

## Package Installation Leads

Package installation is one example of a user activity that triggers lead creation. However, AgentExchange isn’t the only source of installation leads. The License Management App (LMA) also creates installation leads. Let’s look at an example. A user purchases your solution and installs it via an installation URL. AgentExchange isn’t aware of the user’s activity, so it doesn’t create a lead. However, the installation triggers the License Management App to create a lead. To know which application created the lead, check the lead source code.

**note:** The source code for License Management App leads is `Package Installation`.

Let's update the example and see how multiple installation leads are created for the same package. First, a user clicks **Get It Now**, and starts but doesn’t complete the installation. AgentExchange creates a lead with source code `SFDC-IN|Simple Sample App`. Later, the same user purchases your solution and installs it via an installation URL. The License Management App creates a second lead with source code `Package Installation`. Same user. Same package. On the surface, the leads appear to be duplicates, but the lead source codes show that they aren’t.

Learn more about License Management App leads in [Lead and License Records in the LMA](https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/lma_terms_relationships.htm).

## Duplicate Leads

A duplicate lead is a lead that AgentExchange sent to your org for this user, listing, or action within the past 180 days.

Duplicate lead source codes always contain the string `-dup-` and use the format `SFDC-dup-XX|Listing Name`. For example, `SFDC-dup-DM|Simple Sample App` indicates a duplicate lead from a user who clicked **View Demo** on the Simple Sample App listing.
