Skip to main content
Salesforce Object: 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)
The export happens automatically after the create or update action 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 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 LastModifiedDate newer than the last successful sync are pulled into WeGive
This means:
  • 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 LastModifiedDate field, 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:
  1. Parent Campaign exists (if applicable): If the campaign has a parent campaign, that parent must have a Salesforce ID
The integration will automatically push the parent campaign if it doesn’t have a Salesforce ID yet. The integration handles:
  • 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 FieldWeGive FieldWeGive API FieldDirectionTypeNotes
IdSalesforce IDsalesforce_idImport from SalesforceHard-codedSalesforce’s unique identifier for this campaign
NameCampaign NamenameBoth WaysConfigurable import / Hard-coded exportDisplay name of the campaign
StartDateStart Datestart_dateBoth WaysConfigurableDate the campaign begins
EndDateEnd Dateend_dateBoth WaysConfigurableDate the campaign ends
ExpectedRevenueGoal Amountgoal_dollarsBoth WaysConfigurableFundraising goal in dollars (WeGive stores in cents)
ParentIdParent Campaign Salesforce IDparent_campaign.salesforce_idBoth WaysConfigurableLinks to parent campaign for hierarchies
CreatedDateCreated Atcreated_atImport from SalesforceHard-codedWhen 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
The integration maintains these relationships:
  • 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 as Y-m-d (e.g., “2025-01-15”) when syncing to Salesforce and are adjusted to the organization’s timezone:
  • start_date - When the campaign begins
  • end_date - When the campaign ends
Dates are optional and can be null for evergreen or ongoing campaigns.

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
This field is called 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_id for 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
When exporting a campaign with a parent:
  • 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_id exists: The integration CREATES a new Campaign record in Salesforce
Step 2: Handle Parent Campaign If the campaign has a parent campaign:
  • 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
Note: Unlike donors, campaigns are NOT matched by name or other criteria. Each WeGive campaign maps to exactly one Salesforce campaign record based solely on the stored Salesforce ID.

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
Step 2: Handle Parent Campaign If the campaign has a 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
Step 3: Import Data
  • 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
These rules are configured in the 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)
For Salesforce to WeGive:
  • Id (Salesforce ID - automatically provided)
  • Name (required field)
All other fields are optional and will sync according to the mapping rules configured for your organization.

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 Name field is configurable on import to allow organizations to map from custom field names
  • The Name field is hard-coded on export to ensure the required Salesforce field is always populated

Best Practices

  1. Use clear, descriptive names that identify the campaign purpose
  2. Set realistic goals that are achievable and motivating
  3. Define date ranges for time-bound campaigns to track performance
  4. Leverage hierarchies to organize related campaigns (e.g., Annual Fund > Q1 Appeal)
  5. Create campaigns before donations to ensure proper attribution
  6. Sync campaigns early in the integration setup process
  7. Use consistent naming conventions across both systems
  8. Archive old campaigns rather than deleting to preserve historical data
  9. Monitor campaign performance regularly through reporting
  10. 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
Parent campaign link broken:
  • 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
Goal amounts don’t match:
  • WeGive stores amounts in cents, Salesforce in dollars - verify conversion
  • Check for rounding issues with decimal amounts
  • Ensure the goal field is mapped correctly
Dates not displaying correctly:
  • Verify timezone settings between systems
  • Check date formatting in both systems
  • Ensure dates are properly formatted (Y-m-d)
Duplicate campaigns:
  • 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
Custom fields not syncing:
  • 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