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 donors (Contacts) and campaigns, tracking which supporters are associated with specific fundraising initiatives. In WeGive, these are called “Campaign Donors” and serve the same purpose - linking donors to campaigns for targeted communication, reporting, and engagement tracking. Important Note: Campaign Members in Salesforce can only link to Contacts, not Accounts. This means only individual donors (not companies) can be added as campaign members through this integration.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
Sync Triggers
From WeGive to Salesforce (Export)
Campaign Member data is exported from WeGive to Salesforce when:- Campaign Donor Created: A new donor is added to a campaign in WeGive
- Campaign Donor Updated: An existing campaign donor relationship is modified in WeGive
- Campaign Donor Deleted: A donor is removed from a campaign in WeGive
From Salesforce to WeGive (Import)
Campaign Member data is imported from Salesforce to WeGive based on:- Last Modified Date: WeGive periodically polls Salesforce for Campaign Members that have been modified since the last sync
- Sync Frequency: The integration checks for updated Campaign Members on a scheduled basis (frequency varies by integration configuration)
- Modified Field Tracking: Only Campaign Members with a
LastModifiedDatenewer than the last successful sync are pulled into WeGive - Deleted Members: The integration tracks deleted campaign members via
IsDeleted = truequeries
- Creating a new Campaign Member in Salesforce will import it to WeGive on the next sync cycle
- Updating an existing Campaign Member in Salesforce will trigger an import to WeGive on the next sync cycle
- Deleting a Campaign Member in Salesforce will remove it from WeGive on the next sync cycle
- The sync is based on Salesforce’s
LastModifiedDatefield, not individual field changes
Sync Process Overview
Campaign Member-Level Synchronization
WeGive syncs campaign members at the individual relationship level, maintaining the connection between donors and campaigns. This includes membership status and basic relationship tracking.Pulling Data from Salesforce
When pulling data from Salesforce, WeGive queries Campaign Member records based on the last modified date. The integration pulls data from the Campaign Member record and its related objects. The import process includes:- Query Campaign Members: Fetches Campaign Member records by last modified date
- Load Related Campaigns: Loads campaigns that match the Campaign IDs from the members
- Load Related Donors: Loads donors (contacts) that match the Contact IDs from the members
- Create or Update: Creates new or updates existing campaign donor relationships in WeGive
Pushing Data to Salesforce
When a Campaign Donor is created or updated in WeGive, the integration ensures all prerequisites exist before creating the Campaign Member in Salesforce. Prerequisites for Creating Campaign Members: Before creating a campaign member in Salesforce, the integration ensures:- Donor exists in Salesforce: The donor must have a
salesforce_id(Contact ID) - Campaign exists in Salesforce: The campaign must have a
salesforce_id
- Queries for existing Campaign Member with matching
CampaignIdandContactId - If found, links the WeGive campaign donor to that existing Campaign Member
- If not found, creates a new Campaign Member
Standard Field Mappings
| Salesforce Field | WeGive Field | WeGive API Field | Direction | Type | Notes |
|---|---|---|---|---|---|
| Id | Salesforce ID | salesforce_id | Import from Salesforce | Hard-coded | Salesforce’s unique identifier for this campaign member |
| CampaignId | Campaign Salesforce ID | campaign.salesforce_id | Both Ways | Hard-coded | Links to the Campaign |
| ContactId | Donor Salesforce ID | donor.salesforce_id | Both Ways | Hard-coded | Links to the Contact (individual donor) |
| Status | Status | status | Import from Salesforce | Hard-coded | Membership status (e.g., “Sent”, “Responded”) |
| LastModifiedDate | Last Modified | (tracking) | Import from Salesforce | Hard-coded | When the membership was last updated |
Important Notes
Contact-Only Limitation
Campaign Members in Salesforce can only link to Contacts, not Accounts:- Individual donors (WeGive donor type = ‘individual’) can be added as campaign members
- Company donors (WeGive donor type = ‘company’) cannot be added as campaign members through this integration
- This is a Salesforce limitation, not a WeGive limitation
Status Field
TheStatus field in Salesforce tracks the member’s response to the campaign:
- Common values: “Sent”, “Responded”, “Declined”, etc.
- Status values are defined by picklist on the Campaign object
- On import, WeGive stores the status value
- On export, WeGive does not set the status (Salesforce defaults apply)
Automatic Donor and Campaign Push
When creating a campaign member, the integration automatically ensures prerequisites:- If the donor doesn’t have a
salesforce_id, the donor is pushed first - If the campaign doesn’t have a
salesforce_id, the campaign is pushed first - Then the campaign member relationship is created
Deletion Handling
When a campaign donor is deleted in WeGive:- The integration marks it for deletion
- On the next push, it deletes the Campaign Member in Salesforce
- The donor and campaign records remain - only the relationship is deleted
- The integration detects it through the deleted records query
- The campaign donor relationship is removed from WeGive
- The donor and campaign records remain - only the relationship is deleted
Campaign Member Matching & Create/Update Logic
When WeGive Exports a Campaign Donor to Salesforce
The integration uses the following logic: Step 1: Ensure Prerequisites Exist- Check if the donor has a
salesforce_id- If not, push the donor first
- Check if the campaign has a
salesforce_id- If not, push the campaign first
- If existing Campaign Member found:
- Store the Salesforce ID on the WeGive campaign donor
- Do not create a duplicate
- This is considered “linking” to the existing record
- If the WeGive campaign donor has a
salesforce_id:- If not deleted: UPDATE the existing Campaign Member
- If deleted: DELETE the Campaign Member in Salesforce
- If no
salesforce_idand no existing member found:- CREATE a new Campaign Member in Salesforce
When Salesforce Exports a Campaign Member to WeGive
Step 1: Find or Create Campaign Donor The integration searches for an existing campaign donor:- First, try to find by
salesforce_id - If not found, try to find by matching
donor_idandcampaign_id - If still not found, create a new campaign donor
- Find the donor in WeGive by matching the
ContactIdtosalesforce_id- If donor not found, throw an exception
- Find the campaign in WeGive by matching the
CampaignIdtosalesforce_id- If campaign not found, throw an exception
- Link the campaign donor to the donor
- Link the campaign donor to the campaign
- Store the Salesforce Campaign Member ID
- Save the record
Deleted Campaign Members from Salesforce
The integration handles deleted members through a separate query:- Queries Campaign Members where
IsDeleted = true - Finds matching campaign donors in WeGive by
salesforce_id - Deletes the WeGive campaign donor relationship
Why This Matters
This matching logic ensures:- No duplicate campaign member relationships are created
- Both systems can independently create the same relationship without conflicts
- Deletions are properly synced in both directions
- Prerequisites (donor and campaign) always exist before creating the relationship
Required Fields
For WeGive to Salesforce:- CampaignId (Campaign Salesforce ID)
- ContactId (Donor Salesforce ID)
- Id (Salesforce Campaign Member ID)
- CampaignId (Campaign Salesforce ID)
- ContactId (Donor Salesforce ID)
Usage in WeGive
Campaign Donors in WeGive are used for:- Targeted Communication: Send emails or messages to campaign supporters
- Segmentation: Create lists of donors interested in specific campaigns
- Engagement Tracking: Monitor which campaigns donors engage with
- Follow-up: Identify donors to thank or solicit for future giving
- Reporting: Analyze donor participation across campaigns
- Multi-touch Attribution: Track which campaigns influenced a donor’s giving
Usage in Salesforce
Campaign Members in Salesforce are used for:- Marketing Automation: Target supporters with campaign-specific messaging
- Response Tracking: Monitor who responded to campaign appeals
- ROI Analysis: Calculate campaign effectiveness based on member conversion
- Engagement Scoring: Track donor engagement across multiple campaigns
- Email Marketing: Sync with marketing automation platforms
- Reporting: Standard Salesforce campaign reports show member statistics
- Campaign Influence: Track multi-touch attribution in the opportunity lifecycle
Integration Rules
Currently, campaign member field mappings are entirely hard-coded. There are no configurable mapping rules for campaign members, as the data structure is standardized across Salesforce implementations. The integration focuses on maintaining the core relationship between donors and campaigns without additional custom fields.Best Practices
- Add donors to campaigns early in their engagement journey
- Use consistent campaign selection when processing donations
- Clean up old memberships for inactive campaigns to reduce clutter
- Monitor sync logs for failed campaign member creations
- Ensure donors exist before adding them to campaigns
- Don’t manually create duplicates - let the integration handle deduplication
- Use campaign hierarchies to organize related campaign memberships
- Track status changes in Salesforce to understand donor response
- Coordinate with marketing team on campaign member usage
- Document when to add members vs. when donations automatically create them
Troubleshooting
Campaign member not syncing:- Verify the donor has a
salesforce_id(is a Contact, not just an Account) - Check that the campaign has a
salesforce_id - Ensure the donor is an individual, not a company
- Verify the integration has access to the CampaignMember object
- The integration should prevent duplicates automatically
- If duplicates exist, they may have been created outside the integration
- Merge duplicates in Salesforce, keeping the one with the WeGive relationship
- Campaign Members can only link to Contacts in Salesforce
- Company donors cannot be added as campaign members
- This is a Salesforce limitation, not an integration issue
- Verify the deleted campaign members query is running
- Check that deletions are processing in both directions
- Ensure no competing process is recreating the relationships
- The donor or campaign doesn’t exist in Salesforce
- Run a manual sync of donors and campaigns first
- Check that the prerequisite records have valid Salesforce IDs
- The integration imports status but does not export it
- Status updates must be made in Salesforce
- Use Salesforce workflows or process builder to automate status changes
Understanding Hard-coded Mappings
All campaign member field mappings are hard-coded because:- The CampaignMember object structure is standardized in Salesforce
- The relationship is simple: just donor + campaign + status
- Additional complexity is handled through Campaign object fields, not member fields
- Custom fields on Campaign Members are rarely used in practice