---
schema_version: "1"
id: 7067f1f531c2465ae0536ce046f4fa10bc546d1a270251899016433f3571e946
title: CampaignInfluenceModel
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_campaigninfluencemodel.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_campaigninfluencemodel.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 0b291a3228257c46a5229198d5246350e546a6ede9b079b7aa7db5e30b39c970
description: Represents a campaign influence model used by Customizable Campaign Influence. You can’t configure Customizable Campaign Influence via the Metadata API, but you can add a campaign influence model.
---
# CampaignInfluenceModel

Represents a campaign influence model used by Customizable Campaign Influence. You can’t configure Customizable Campaign Influence via the Metadata API, but you can add a campaign influence model.

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

![Note](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note.png)

#### Note

This information applies only to Customizable Campaign Influence and not to [Campaign Influence 1.0](https://help.salesforce.com/s/articleView?id=sf.campaigns_influence_original.htm&language=en_US) .

## File Suffix and Directory Location

CampaignInfluenceModel values are stored in the campaignInfluenceModels directory of the corresponding package directory. The file name matches the model name, and the extension is .campaignInfluenceModel.

## Version

CampaignInfluenceModel components are available in API version 38.0 and later.

## Fields

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d219955e104">Field Name</th>

              <th class="featureTableHeader  " id="d219955e107">Field Type</th>

              <th class="featureTableHeader  " id="d219955e110">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">isActive</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">boolean</td>

              <td class="entry" headers="d219955e110" data-title="Description">Indicates whether the model is active. Active models can generate
                campaign influence records. Deactivating a model deletes its
                campaign influence records. Custom models are always active and this
                field is ignored. This field is available beginning with API version
                40.0.</td>

            </tr>

            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">isDefaultModel</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">boolean</td>

              <td class="entry" headers="d219955e110" data-title="Description">Required. Indicates if the model is the default model or not.
                Only campaign influence records associated with the default model
                appear on campaigns and opportunities. You can only have one default
                model at a time. A model must be active to become the default
                model.<p class="p">Activating or deactivating custom models does not
                  automatically generate or delete campaign influence
                  records.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">isModelLocked</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">boolean</td>

              <td class="entry" headers="d219955e110" data-title="Description">Required. Indicates if the model is locked or not. Campaign
                Influence records for locked models can be manipulated only via the
                API.</td>

            </tr>

            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">modelDescription</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">string</td>

              <td class="entry" headers="d219955e110" data-title="Description">A description of the influence model.</td>

            </tr>

            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">name</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">string</td>

              <td class="entry" headers="d219955e110" data-title="Description">Required. A unique name for the model.</td>

            </tr>

            <tr>
              <td class="entry" headers="d219955e104" data-title="Field Name"><span class="keyword parmname">recordPreference</span></td>

              <td class="entry" headers="d219955e107" data-title="Field Type">picklist</td>

              <td class="entry" headers="d219955e110" data-title="Description">The value of this field determines when to create campaign
                influence records.<ul class="ul bulletList">
                  <li class="li">
                    <samp class="codeph nolang">AllRecords</samp>: Creates
                    records regardless of the revenue attribution
                    percentage.
                  </li>

                  <li class="li">
                    <samp class="codeph nolang">RecordsWithAttribution</samp>:
                    Creates records only when the revenue attribution is greater
                    than 0%.
                  </li>

                </ul>
                <p class="p">This field is available In API version 41.0 and
                  later.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Declarative Metadata Sample Definition

The following is an example of a CampaignInfluenceModel component that represents the default Salesforce campaign influence attribution model. The default isDefaultModel value of true can be changed if another model is created and set as the default model. The isModelLocked value of true means that Campaign Influence records for this model can be seen in the UI, but not created, updated, or deleted.

<?xml version="1.0" encoding="UTF-8"?>
<CampaignInfluenceModel xmlns="http://soap.sforce.com/2006/04/metadata">
    <isActive\>true</isActive\>
    <isDefaultModel\>true</isDefaultModel\>
    <isModelLocked\>true</isModelLocked\>    <recordPreference\>AllRecords</recordPreference\>   
    <modelDescription\>Primary Campaign gets 100% of the revenue share</modelDescription\>
    <name\>Salesforce Model</name\>
</CampaignInfluenceModel\>

The following is an example of a CampaignInfluenceModel component that creates an influence model called Last Touch, which will not be the default model.

<?xml version="1.0" encoding="UTF-8"?>
<CampaignInfluenceModel xmlns="http://soap.sforce.com/2006/04/metadata">
    <isActive\>true</isActive\>
    <isDefaultModel\>false</isDefaultModel\>
    <isModelLocked\>true</isModelLocked\>
    <modelDescription\>This model gives 100% influence attribution to the last campaign that touched the contact.</modelDescription\>
    <name\>Last Touch</name\>
    <recordPreference\>RecordsWithAttribution</recordPreference\>
</CampaignInfluenceModel\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).