Campaign (standard NPSP 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 serve as a way to organize and track donations, communicate 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
- Configurable - Can be customized via integration settings
- Hard-coded - Built into the integration logic and cannot be changed
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 (e.g., name changed, dates updated, goal modified, description edited)
From Salesforce to WeGive (Import)
Campaign data is imported from Salesforce to WeGive based on:- Last Modified Date: WeGive periodically polls Salesforce for Campaigns that have been modified since the last sync
- Sync Frequency: The integration checks for updated Campaigns on a scheduled basis (frequency varies by integration configuration)
- Modified Field Tracking: Only Campaigns with a
LastModifiedDatenewer than the last successful sync are pulled into WeGive
- 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 Salesforce’s
LastModifiedDatefield, not individual field changes
Sync Process Overview
Campaign-Level Synchronization
WeGive syncs campaigns at the Campaign object level in Salesforce, maintaining campaign information, goals, dates, hierarchies, and custom fields.Pulling Data from Salesforce
When pulling data from Salesforce, WeGive queries Campaign records based on the last modified date and any specific filtering criteria. The integration pulls comprehensive data from the Campaign record, including all standard and custom fields that have been mapped. The import process includes:- Campaign Identification: Creates or updates the corresponding WeGive Campaign record
- Hierarchy Management: Maintains parent campaign relationships
- Goal and Date Tracking: Imports fundraising goals, start dates, and end dates
- Custom Fields: Imports any custom fields configured through mapping rules
- Metadata: Preserves created date and other tracking information
Pushing Data to Salesforce
When a Campaign is created or updated in WeGive, the integration compiles a payload for the Salesforce Campaign object. This payload includes all mapped fields and ensures that the Campaign record is properly created or updated in Salesforce. Prerequisites for Creating Campaigns: Before creating a campaign in Salesforce, the integration ensures:- Parent Campaign exists (if applicable): If the campaign has a parent campaign, that parent must have a Salesforce ID
- Standard Fields: Name, start date, end date, goal amount
- Parent Campaign: Links to parent campaigns for hierarchies
- Custom Fields: Any organization-specific fields configured through mapping rules
- Date Formatting: Properly formats dates to Y-m-d format
- Amount Conversion: Converts goal amounts from cents to dollars
Campaign Field Mappings
| lesforce 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 |
| Name | Campaign Name | name | Both Ways | Configurable import / Hard-coded export | Display name of the campaign |
| StartDate | Start Date | start_date | Both Ways | Configurable | Date the campaign begins |
| EndDate | End Date | end_date | Both Ways | Configurable | Date the campaign ends |
| ExpectedRevenue | Goal Amount | goal_dollars | Both Ways | Configurable | Fundraising goal in dollars (WeGive stores in cents) |
| ParentId | Parent Campaign Salesforce ID | parent_campaign.salesforce_id | Both Ways | Configurable | Links to parent campaign for hierarchies |
| CreatedDate | Created At | created_at | Import from Salesforce | Hard-coded | When the campaign was created |
Note: Additional fields can be mapped through integration rules. The fields shown above represent the standard Campaign fields that are commonly mapped.
Important Notes
Campaign Hierarchies
Campaigns in both WeGive and Salesforce support parent-child relationships:- Parent Campaigns: Main campaign initiatives
- Child Campaigns: Sub-campaigns that roll up to a parent
- When creating a child campaign, the parent must exist in Salesforce first
- The integration will automatically push the parent campaign if needed
- Updates to campaign hierarchies sync bidirectionally
- Both systems support multi-level hierarchies
Date Formatting
All dates are formatted asY-m-d (e.g., “2025-01-15”) when syncing to Salesforce and are adjusted to the organization’s timezone:
start_date- When the campaign beginsend_date- When the campaign ends
Goal Amount Conversion
The goal amount requires conversion between systems:- WeGive: Stores goal in cents as an integer (e.g., 50000 = $500.00)
- Salesforce: Stores goal in dollars as
ExpectedRevenue(e.g., 500.00) - On export: WeGive divides by 100 to convert cents to dollars
- On import: Salesforce value is multiplied by 100 to convert to cents
goal_dollars in the mapping but represents the goal field in WeGive (stored in cents).
Parent Campaign Linking
When importing a campaign with a parent:- The integration searches for a WeGive campaign with matching
salesforce_idfor the parent - If the parent campaign doesn’t exist in WeGive, it will be imported on the next sync cycle
- Parent relationships are only established when both campaigns exist
- The parent campaign must have a
salesforce_id - If the parent doesn’t have a
salesforce_id, the integration will push it first - This ensures campaign hierarchies remain intact
Campaign Matching & Create/Update Logic
When WeGive Exports a Campaign to Salesforce
The integration uses the following logic to determine whether to create a new Campaign or update an existing one: Step 1: Check for Existing Salesforce Campaign ID- If the WeGive campaign has a
salesforce_id: The integration UPDATES the existing Campaign record in Salesforce - If no
salesforce_idexists: The integration CREATES a new Campaign record in Salesforce
- Check if the parent has a
salesforce_id - If not, push the parent campaign first
- Then create/update the child campaign with the parent reference
When Salesforce Exports a Campaign to WeGive
Step 1: Check for Existing WeGive Campaign- The integration searches for an existing campaign by
salesforce_id - If found, it updates that campaign
- If not found, it creates a new campaign
ParentId:
- Search for a WeGive campaign with that
salesforce_id - If found, link as the parent campaign
- If not found, the parent will be linked when it’s imported
- All mapped fields are imported from the Campaign record
- Date values are parsed and stored appropriately
- Goal amounts are converted from dollars to cents
- Custom field values are processed through the custom fields system
Why This Matters
This matching logic ensures:- Each WeGive campaign maps to exactly one Salesforce Campaign record
- Campaign hierarchies are maintained correctly
- Historical campaign data remains intact
- No duplicate campaigns are created during sync operations
Integration Rules
Organizations can create custom mapping rules for campaigns to handle:- Additional custom fields on the Campaign object
- Organization-specific campaign tracking fields
- Custom reporting or categorization fields
- Marketing campaign fields
- Budget tracking fields
neon_mapping_rules table with:
crm= ‘salesforce’integration= ‘campaign’level= ‘import’, ‘export’, or ‘both’
Example Configurable Mappings
The integration supports both configurable import and hard-coded export for the Name field. Other commonly configurable fields include:- Custom status fields
- Campaign type or category
- Budget vs. actual tracking
- Marketing source codes
- Campaign manager/owner fields
Required Fields
For WeGive to Salesforce:- Name (required by Salesforce)
- Id (Salesforce ID - automatically provided)
- Name (required field)
Usage in WeGive
Campaigns in WeGive are used for:- Organizing Donations: Group donations by campaign for reporting
- Goal Tracking: Set and track progress toward fundraising goals
- Donor Communication: Send targeted communications to campaign supporters
- Fundraising Pages: Create dedicated giving pages for specific campaigns
- Event Management: Link campaigns to events for comprehensive tracking
- P2P Fundraising: Enable peer-to-peer fundraising with campaign fundraisers
- Multi-Channel Attribution: Track which campaigns drive donations across channels
Usage in Salesforce NPSP
Campaigns in Salesforce are used for:- Campaign Members: Track which contacts are associated with each campaign
- Opportunity Attribution: Link donations (Opportunities) to campaigns
- Campaign Hierarchies: Roll up results from child campaigns to parent campaigns
- ROI Analysis: Compare campaign costs vs. revenue raised
- Campaign Influence: Track multi-touch attribution across campaigns
- Reporting: Analyze campaign performance and effectiveness
- Engagement Tracking: Monitor supporter engagement with campaigns
Understanding Configurable vs Hard-coded
- Configurable mappings can be customized through integration settings if needed for your organization’s specific field setup
- Hard-coded mappings are built into the integration’s core logic and handle essential campaign identification and tracking
- The
Namefield is configurable on import to allow organizations to map from custom field names - The
Namefield is hard-coded on export to ensure the required Salesforce field is always populated
Best Practices
- Use clear, descriptive names that identify the campaign purpose
- Set realistic goals that are achievable and motivating
- Define date ranges for time-bound campaigns to track performance
- Leverage hierarchies to organize related campaigns (e.g., Annual Fund > Q1 Appeal)
- Create campaigns before donations to ensure proper attribution
- Sync campaigns early in the integration setup process
- Use consistent naming conventions across both systems
- Archive old campaigns rather than deleting to preserve historical data
- Monitor campaign performance regularly through reporting
- Train staff on proper campaign selection when processing donations
Troubleshooting
Campaign not syncing:- Verify the campaign has been modified since the last sync time
- Check that the integration has access to the Campaign object
- Ensure required fields (Name) are populated
- Verify the parent campaign exists in both systems
- Check that the parent campaign has a
salesforce_id - Ensure the parent campaign synced before the child campaign
- WeGive stores amounts in cents, Salesforce in dollars - verify conversion
- Check for rounding issues with decimal amounts
- Ensure the goal field is mapped correctly
- Verify timezone settings between systems
- Check date formatting in both systems
- Ensure dates are properly formatted (Y-m-d)
- Campaigns are only matched by Salesforce ID
- Creating a campaign with the same name in both systems will create duplicates
- Merge duplicate campaigns in the system of record, then sync
- Verify custom field mapping rules are configured
- Check that field API names match in the mapping rules
- Ensure the integration has permission to access custom fields