Newer Version Available
CampaignInfluenceModel
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
| Field Name | Field Type | Description |
|---|---|---|
| isActive | boolean | 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. |
| isDefaultModel | boolean | 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. Activating or deactivating custom models does not automatically generate or delete campaign influence records. |
| isModelLocked | boolean | Required. Indicates if the model is locked or not. Campaign Influence records for locked models can be manipulated only via the API. |
| modelDescription | string | A description of the influence model. |
| name | string | Required. A unique name for the model. |
| recordPreference | picklist | The value of this field determines when to create campaign
influence records.
This field is available In API version 41.0 and later. |
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.
1<?xml version="1.0" encoding="UTF-8"?>
2<CampaignInfluenceModel xmlns="http://soap.sforce.com/2006/04/metadata">
3 <isActive>true</isActive>
4 <isDefaultModel>true</isDefaultModel>
5 <isModelLocked>true</isModelLocked> <recordPreference>AllRecords</recordPreference>
6 <modelDescription>Primary Campaign gets 100% of the revenue share</modelDescription>
7 <name>Salesforce Model</name>
8</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.
1<?xml version="1.0" encoding="UTF-8"?>
2<CampaignInfluenceModel xmlns="http://soap.sforce.com/2006/04/metadata">
3 <isActive>true</isActive>
4 <isDefaultModel>false</isDefaultModel>
5 <isModelLocked>true</isModelLocked>
6 <modelDescription>This model gives 100% influence attribution to the last campaign that touched the contact.</modelDescription>
7 <name>Last Touch</name>
8 <recordPreference>RecordsWithAttribution</recordPreference>
9</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.