Campaign (standard object)WeGive Model: Campaign
Overview
This document describes how campaign data syncs between WeGive and Salesforce. Campaigns represent fundraising initiatives, events, appeals, or programs. They organize and track donations, drive communication with supporters, and measure fundraising success. In NPSP, campaigns are a standard Salesforce object with enhanced functionality for tracking donors, donations, and campaign hierarchies.How Campaign 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
- Configurable (mapping rule) - Only synced when an integration mapping rule for the Campaign object targets the field. Nothing is sent or read for these fields by default.
Sync Configuration
Campaign sync is controlled by the following integration toggles:- Pull campaigns - Enables the scheduled import of Campaigns from Salesforce
- Push campaigns - Enables the export of WeGive campaigns to Salesforce
pull_deleted_campaigns- When enabled, Campaigns deleted in Salesforce are also deleted (soft-deleted) in WeGive
Sync Triggers
From WeGive to Salesforce (Export)
Campaign data is exported from WeGive to Salesforce when:- Campaign Created: A new campaign is created in WeGive
- Campaign Updated: An existing campaign is modified in WeGive
From Salesforce to WeGive (Import)
Campaign data is imported from Salesforce to WeGive based on:- Last Modified Date: WeGive periodically polls Salesforce for Campaigns whose
LastModifiedDatefalls in the window since the last sync. (The pull field defaults toLastModifiedDateand can be changed with thepull_bysetting.) - Sync Frequency: The integration checks for updated Campaigns on a scheduled basis (frequency varies by integration configuration)
- Creating a new Campaign in Salesforce will import it to WeGive on the next sync cycle
- Updating an existing Campaign in Salesforce will trigger an import to WeGive on the next sync cycle
- The sync is based on the record’s modification timestamp, not individual field changes
Deleted Campaigns
Whenpull_deleted_campaigns is enabled, the integration queries Salesforce for Campaigns with IsDeleted = true in the sync window. Any WeGive campaign whose salesforce_id matches is soft-deleted in WeGive.
Campaign deletions are not pushed from WeGive to Salesforce.
Sync Process Overview
Pulling Data from Salesforce
The import queries the Campaign object forId, CreatedDate, and every Salesforce field referenced by an import-level mapping rule for campaigns. The import process:
- Campaign Identification: Finds the WeGive campaign with a matching
salesforce_id, or creates a new one - Hierarchy Management: If a mapping rule provides the parent campaign’s Salesforce ID, the integration looks for a WeGive campaign with that
salesforce_idand links it as the parent. If no such WeGive campaign exists yet, no parent link is set on this pass. - Mapped Fields: Fills every field a mapping rule supplies (name, dates, goal, and so on)
- Custom Fields: Fills WeGive custom field values from mapped Salesforce fields
- Metadata: Stores the Salesforce
CreatedDateas the WeGive created date
Pushing Data to Salesforce
When a Campaign is created or updated in WeGive, the integration compiles a payload for the Salesforce Campaign object. By default the payload contains only:Name- the WeGive campaign namewegive__WeGive_Id__c- the WeGive campaign ID
start_dateandend_date, formattedY-m-din the organization’s timezone (UTC if none is set)goal_dollars, the WeGive goal converted from cents to dollarsparent_campaign, the parent campaign’s attributes (includingparent_campaign.salesforce_id)- Any WeGive custom field values, keyed by the custom field’s API name
wegive__WeGive_Entity__c on pushed campaigns and filters pulled campaigns by entity when the campaign domain is entity-scoped.
Campaign Field Mappings
The Salesforce field names shown for the configurable rows are the conventional targets. Your organization’s mapping rules determine which Salesforce fields are actually used.
Important Notes
Campaign Hierarchies
Campaigns in both WeGive and Salesforce support parent-child relationships. The integration maintains them as follows:- On import, the parent link is set only if the parent already exists in WeGive with a matching
salesforce_id. Otherwise the child is imported without a parent, and the link is not retroactively created until the child is modified again in Salesforce and re-imported. - On export, the parent’s
salesforce_idis exposed to mapping rules. The parent is not pushed first; if it has nosalesforce_id, the child is created without a parent reference.
Date Formatting
On export,start_date and end_date are converted to the organization’s timezone and formatted Y-m-d. Dates are optional and can be null for evergreen or ongoing campaigns. No date conversion is performed on import.
Goal Amount Conversion
- WeGive stores the goal in cents as an integer (e.g., 50000 = $500.00)
- On export,
goal_dollarsis the goal divided by 100 - On import, the Salesforce value is stored as provided by the mapping rule; the integration does not multiply by 100
Campaign Matching & Create/Update Logic
When WeGive Exports a Campaign to Salesforce
- If the WeGive campaign has a
salesforce_id: the integration UPDATES the existing Campaign - If no
salesforce_idexists: the integration CREATES a new Campaign (a lock prevents two concurrent pushes from creating duplicates)
When Salesforce Exports a Campaign to WeGive
- The integration searches for an existing WeGive campaign by
salesforce_id - If found, it updates that campaign; if not found, it creates a new one
- Mapped fields, the parent link (when resolvable), and custom field values are applied
Integration Rules
Organizations can create mapping rules for campaigns to handle standard fields (dates, goal, parent) and any custom fields on the Campaign object. Rules are configured with:crm= ‘salesforce’integration= ‘campaign’level= ‘import’, ‘export’, or ‘both’
Required Fields
For WeGive to Salesforce:- Name (always sent)
- Id (automatically selected)
Troubleshooting
Campaign not syncing:- Verify the campaign has been modified since the last sync time
- Confirm the Pull campaigns / Push campaigns toggles are enabled
- Check that the integration has access to the Campaign object
- Confirm the parent campaign exists in both systems with a
salesforce_id - Sync the parent before the child; the integration does not push parents automatically
- Confirm a mapping rule maps
parent_campaign.salesforce_idtoParentId
- These fields are sent only through mapping rules; confirm rules exist for
start_date,end_date, andgoal_dollars
- Campaigns are only matched by Salesforce ID; creating the same campaign in both systems will create duplicates
- If
pull_deleted_campaignsis enabled, deleting a Campaign in Salesforce soft-deletes it in WeGive