CampaignMember (standard Salesforce object)WeGive Model: CampaignDonor
Overview
This document describes how campaign member data syncs between WeGive and Salesforce. Campaign Members represent the relationship between a donor and a campaign, tracking which supporters are associated with specific fundraising initiatives. In WeGive, these are called “Campaign Donors” and serve the same purpose. Campaign Members link to a Contact by default. If your Salesforce org has enabled Accounts as Campaign Members, the integration also supports linking company donors through theAccountId field. See Contact and Account Members.
How Campaign Member Data Syncs
Direction
- Import from Salesforce - Data imports from Salesforce into WeGive only
- Export to Salesforce - Data exports from WeGive to Salesforce only
- Both Ways - Data syncs in both directions
Mapping Types
- Hard-coded - Built into the integration logic and cannot be changed. There are no configurable mapping rules for campaign members.
Sync Configuration
- Pull campaign donors - Enables the scheduled import of Campaign Members
- Push campaign donors - Enables the export of WeGive campaign donors
pull_deleted_campaign_donors- When enabled, Campaign Members deleted in Salesforce are also removed in WeGive
Sync Triggers
From WeGive to Salesforce (Export)
- Campaign Donor Created: A new donor is added to a campaign in WeGive. A Campaign Member is created in Salesforce.
- Campaign Donor Updated: Because
CampaignIdandContactId/AccountIdare read-only after creation and no other fields are synced, an update in WeGive sends nothing to Salesforce. - Campaign Donor Deleted: A donor is removed from a campaign in WeGive. The Campaign Member is deleted in Salesforce.
From Salesforce to WeGive (Import)
- Last Modified Date: WeGive periodically polls Salesforce for Campaign Members whose
LastModifiedDatefalls in the window since the last sync - Deleted Members: When
pull_deleted_campaign_donorsis enabled, the integration also queries for members withIsDeleted = truein the same window and removes the matching WeGive campaign donors
Sync Process Overview
Pulling Data from Salesforce
The integration selectsId, CampaignId, ContactId, Status, and LastModifiedDate (plus AccountId when Accounts as Campaign Members is enabled). For each record it:
- Loads the WeGive campaigns matching the
CampaignIdvalues - Loads the WeGive individual donors matching the
ContactIdvalues, and, when applicable, company donors matching theAccountIdvalues - Creates or updates the campaign donor relationship
Status is queried but is not stored in WeGive. Campaign member status lives only in Salesforce.Pushing Data to Salesforce
Before creating a Campaign Member, the integration ensures:- Donor exists in Salesforce: An individual donor must have a
salesforce_id(Contact); a company donor must have asalesforce_account_id(Account). If missing, the donor is pushed first. - Campaign exists in Salesforce: The campaign must have a
salesforce_id. If missing, the campaign is pushed first.
CampaignId and ContactId (or AccountId). If found, the WeGive campaign donor is linked to that record instead of creating a duplicate. If Salesforce still rejects the insert as a duplicate, the integration re-queries by CampaignId and ContactId and links to the match.
Standard Field Mappings
Important Notes
Contact and Account Members
- Individual donors are always linked through
ContactId. - Company donors are linked through
AccountIdonly if the Salesforce org has enabled Accounts as Campaign Members. The integration detects this automatically by checking whether theCampaignMemberobject exposes anAccountIdfield (the result is cached for up to a day). - When the feature is not enabled, campaign donors for company donors are skipped on push with a warning, and
AccountIdis not read on pull.
Status Field
TheStatus field is owned by Salesforce. The integration does not export it and does not store the imported value. Manage status in Salesforce.
Deletion Handling
WeGive to Salesforce: When a campaign donor that already has asalesforce_id is deleted in WeGive, the integration issues a delete for the Campaign Member record. The donor and campaign records remain.
Salesforce to WeGive: When pull_deleted_campaign_donors is enabled, Campaign Members with IsDeleted = true are matched by salesforce_id and the WeGive campaign donor is deleted. The donor and campaign remain. If the setting is off, Salesforce deletions are not reflected in WeGive.
Multi-Entity Orgs
In a multi-entity Salesforce instance, the import is scoped through the parent Campaign’swegive__WeGive_Entity__c field when the campaign domain is entity-scoped.
Campaign Member Matching & Create/Update Logic
When WeGive Exports a Campaign Donor to Salesforce
- Ensure prerequisites (donor and campaign pushed if they lack Salesforce IDs).
- If the campaign donor already has a
salesforce_id:- Deleted in WeGive: DELETE the Campaign Member
- Not deleted: no action (nothing mutable to update)
- If there is no
salesforce_id:- Query Salesforce for a member with the same
CampaignIdandContactId/AccountId - If found: store its ID on the WeGive campaign donor (“link”)
- If not found: CREATE a new Campaign Member
- Query Salesforce for a member with the same
When Salesforce Exports a Campaign Member to WeGive
- Find the WeGive campaign donor by
salesforce_id - If not found, resolve the donor (by
ContactId, thenAccountId) and campaign (byCampaignId) and look for an existing relationship between them - If still not found, create a new campaign donor. If the donor or the campaign cannot be found in WeGive, the record is skipped with an error and will be retried when it is next modified in Salesforce.
- Store the Salesforce Campaign Member ID and save
Required Fields
For WeGive to Salesforce:- CampaignId
- ContactId or AccountId
- Id
- CampaignId
- ContactId or AccountId (the matching donor must already exist in WeGive)
Troubleshooting
Campaign member not syncing:- Verify the donor has a
salesforce_id(individual) orsalesforce_account_id(company) - Check that the campaign has a
salesforce_id - Confirm the Pull / Push campaign donors toggles are enabled
- Enable Accounts as Campaign Members in Salesforce; without it, company campaign donors are skipped
- Confirm
pull_deleted_campaign_donorsis enabled for Salesforce-side deletions - Ensure no other process is recreating the relationship
- The integration neither imports nor exports status; manage it in Salesforce
- Only creation and deletion are synced; there are no updatable fields on a Campaign Member