Salesforce.com

This guide describes how to connect Salesforce (SFDC) with Koddi Ads using Koddi's metadata feature to map records between the two platforms.

The primary workflows are:

  • When advertiser onboarding starts in Koddi, Salesforce pulls the Koddi Advertiser list once a day and links each eligible Advertiser to an existing or new Salesforce Account. Onboarding can also start with an Account in Salesforce.
  • An Opportunity reaching the agreed conversion milestone in SFDC creates the associated Media Plan, Campaigns, and IOs in Koddi.
  • Delivery and performance data can flow from Koddi back to Salesforce through APIs or an agreed data lake integration.

Salesforce manages customer relationships and commercial commitments. Koddi manages media planning, campaign execution, and delivery. The integration connects these workflows through persistent record identifiers.

Object Relationships and Mapping

Koddi’s execution hierarchy is Advertiser → Media Plan → Campaign → Ad Group. IOs are associated separately with campaigns, and one IO can cover multiple campaigns.

Media plans organize campaigns around budgets, flight dates, and goals. Campaigns contain ad groups, which hold execution settings such as targeting, bids, and advertised entities.

The recommended Salesforce mapping is:

Salesforce recordKoddi recordMapping approach
AccountAdvertiserStore the Salesforce Account ID in advertiser metadata
OpportunityMedia PlanStore the Salesforce Opportunity ID in media plan metadata
Opportunity Product, Order Product, or custom media lineCampaignStore the corresponding Salesforce line ID in campaign metadata
Order or custom IO recordIOStore the corresponding Salesforce record ID in IO metadata

Your Salesforce configuration determines the final object mapping. For example, without Salesforce Orders, you may use an Opportunity or custom object as the commercial reference for an IO.

One Opportunity may produce multiple campaigns or IOs. Each resulting Koddi record should carry enough metadata to identify its Salesforce source.

Suggested Metadata Conventions

Use explicit metadata keys in Koddi to distinguish Salesforce object types.

Proposed metadata keyPurpose
salesforce_account_idIdentifies the Salesforce Account
salesforce_opportunity_idIdentifies the originating Opportunity
salesforce_opportunity_line_item_idIdentifies an Opportunity Product, when used
salesforce_order_idIdentifies the Salesforce Order, when used
salesforce_order_item_idIdentifies an Order Product, when used
salesforce_io_idIdentifies a custom Salesforce IO record, when used

These keys are integration conventions. Agree on their names and placement before development, and preserve existing conventions where already established.

Store Salesforce IDs as strings using their 18-character format. Scope mappings to the correct Salesforce organization, Koddi customer environment, and object type.

Metadata identifies the corresponding Salesforce records. Native Koddi IDs and relationships continue to connect advertisers, media plans, campaigns, ad groups, and IOs.

Mapping Experiences to Salesforce Products

A Koddi experience defines an ad type configured for your member group, such as Sponsored Products or Display. Advertisers select an experience when they create a campaign, and IO line items carry an experience_id. In Salesforce, the product catalog usually describes the same choice. A Salesforce Product (the Product2 record behind an Opportunity Product or Order Product) is what the customer buys, and the matching Koddi experience is how that purchase is delivered.

Map each sellable Salesforce Product to one Koddi experience:

SalesforceKoddiMapping approach
Product (Product2 ID or Product Code)Experience (experience_id)Keep a mapping table in the integration; read the experiences from the Experiences API
Opportunity Product or Order ProductCampaignThe line's product selects the experience for the campaign
Opportunity Product or Order ProductIO line itemThe line's product sets the experience_id on the IO line item

For example, a "Sponsored Products" Product maps to the Sponsored Products experience, and a "Display Banner" Product maps to the Display experience. A Holiday Opportunity with one line for each Product produces a Media Plan with one campaign per experience.

Follow these rules:

  • Map each Salesforce Product to one experience. Several Products can map to the same experience, for example when they differ only by price tier or flight length. A Product that spans several experiences should be split into separate lines in Salesforce first.
  • Use the Product2 ID or Product Code as the key, not the product name, because names change.
  • Store the mapping in the integration or in an agreed lookup. Experiences do not carry Salesforce metadata, so do not rely on one in Koddi to resolve the Product.
  • Look up experiences by experience_id for your member group, since IDs differ between customer environments. Validate the mapping in each environment.
  • Reject a conversion when a line's Product has no mapped experience, or the mapped experience is inactive. Raise it as a visible exception instead of falling back to a default.
  • Retain the Salesforce line ID in campaign metadata (see the metadata conventions above), so each campaign can be traced to both its line and its Product.

When a single line needs more than one campaign, for example for different flight periods, each campaign keeps the same Product-to-experience mapping and a distinct execution identifier.

Advertiser Onboarding

Case 1: Start in Koddi

Create the Advertiser in Koddi. Salesforce runs a scheduled sync once per day and pulls the Advertiser list for each configured Koddi member group.

GET https://koddi.io/console/v1/member_groups/{memberGroupId}/advertisers

Use the Koddi Advertisers API with the member group ID provided by Koddi and the integration's authorization credentials. Process all returned pages if the response is paginated. Apply your agreed eligibility rules to the returned advertisers.

  1. For each eligible Advertiser, use its Koddi Advertiser ID within the configured member group to look up the Salesforce Account mapping. If the Advertiser is already linked, reuse the Account and update the agreed fields.
  2. A matching Salesforce Account exists. Link the existing Account using a supplied Salesforce Account ID, an agreed external identifier, or a reviewed match.
  3. A Salesforce Account is needed. If Account creation is enabled and no match exists, validate the required fields and create the Account. Use the scoped Koddi Advertiser ID as a stable external key so subsequent daily runs and retries resolve the same Account. For manual Account creation, keep the mapping pending until an Account ID is available.
  4. Store the Salesforce Account ID in the original Koddi Advertiser's salesforce_account_id metadata. Retain the Koddi Advertiser ID and Account ID in the integration mapping or an agreed Salesforce field. If Salesforce also runs a Salesforce-first onboarding workflow, use the same mapping or external key to resolve the original Advertiser.

Case 2: Start in Salesforce

  1. When an eligible Account is created in Salesforce, resolve any existing Koddi Advertiser mapping using the Salesforce Account ID.
  2. If the Account is already linked, reuse the mapped Advertiser and apply any agreed field updates.
  3. If no mapping exists, check for an existing Koddi Advertiser using an agreed external identifier or a reviewed match. Link the existing Advertiser if found. Otherwise, validate the required advertiser fields and create the Advertiser in Koddi.
  4. Store the Salesforce Account ID in Koddi advertiser metadata as salesforce_account_id. Record the Koddi Advertiser ID and synchronization outcome in the integration's mapping store or an agreed Salesforce field.

For both cases, flag ambiguous matches for review before linking or creating records. Agree on field mappings for advertiser name, currency, time zone, required contact details, and customer-specific configuration. Apply field updates according to the agreed ownership rules. An Account name change should retain the same ID mapping.

The default relationship can be one Account to one Advertiser. If separate advertisers are needed for brands, regions, or business units, define an additional identifier to distinguish those advertisers.

Opportunity Conversion Workflow

For this integration, “converted” means the Opportunity has reached the agreed commercial milestone, typically Closed Won or a specific approved or booked status.

When that milestone is reached, the integration validates the Opportunity and creates or updates the required Koddi objects.

StepIntegration action
Resolve advertiserFind the Koddi Advertiser mapped to the Opportunity’s Account, regardless of where onboarding started. Resolve any missing or ambiguous mapping before creating downstream records. A new advertiser needs ad_category_id, timezone, contact name and email, agency tag, and one channel/publisher
Create IOsCreate the commercial authorizations using the agreed Salesforce source records. Line items need advertiser_id, advertiser_group_id, experience_id, currency_id, and amount; the IO needs company_name
Create media planTranslate the approved plan into the required budget, flight dates, goals, and experience configuration. insertion_order_id is required
Create campaignsTranslate the commercial lines into the required campaign executions
Associate records and submitConnect campaigns to their media plan and applicable IOs, then submit
Save referencesWrite Salesforce IDs into Koddi metadata and record the resulting Koddi IDs

A Salesforce Opportunity Product does not always need to produce exactly one campaign. For example, one commercial line may require multiple campaigns for different experiences or flight periods. Each campaign should retain the same source line reference and a distinct execution identifier.

Koddi’s media plan submission workflow can create child campaigns and ad groups. If that workflow is used, the integration should capture those generated records rather than creating a second set independently.

Creating the records and activating media should follow the agreed operational workflow. Opportunity conversion should trigger activation only when all required approvals and execution requirements have been satisfied. The IO must be approved (status Approved) before its linked campaigns deliver.

Ad Group Handling

Ad groups generally do not require a Salesforce mapping.

They can be created through Koddi’s planning workflows, templates, APIs, or media operations processes. Targeting, bids, entities, and associated assets remain managed at this level within Koddi.

Reporting can roll ad group delivery into its parent campaign, then use campaign metadata to identify the appropriate Salesforce record. This supports commercial reporting without requiring Salesforce to mirror every execution detail.

IO Associations

IOs should be treated as commercial records associated with campaigns. One IO may cover several campaigns within the customer’s agreed structure.

For example, an Opportunity may produce a Holiday Media Plan containing a Sponsored Products campaign and a Display campaign. Both campaigns may be associated with the same Holiday IO.

The IO metadata identifies the Salesforce commercial record. The campaign associations identify which media delivery belongs to that IO.

The integration should validate that each campaign is associated with the intended IO and that commercial amounts reconcile with the approved allocation. An IO amount should not be copied as the full budget of every associated campaign.

Reporting from Koddi to Salesforce

Reporting writeback is optional and can be configured around the customer’s sales, account management, and reconciliation needs.

A typical reporting process is to retrieve delivery data, resolve the Salesforce references from Koddi metadata, aggregate to the required commercial level, and update the corresponding Salesforce fields or related reporting records.

Possible outputs include delivered spend, impressions, clicks, performance against booked budget, and the latest reporting timestamp. Attributed outcomes can be included where configured.

Keep delivered spend separate from booked Opportunity or Order value. Use stable reporting keys so refreshed data updates existing rows. Agree on currency, time zone, reporting latency, and the period over which historical results may be restated.

Campaign totals and their underlying ad group totals represent overlapping delivery. Select one reporting grain for each dataset to prevent double counting.

See our reporting API and secure data collaboration pages for more details.

Updates and Operational Handling

Define ownership for each synchronized field.

InformationRecommended owner
Account and Advertiser identity fieldsBy field, according to the agreed onboarding and update rules
Opportunities, Orders, and other commercial recordsSalesforce
Approved commercial budget and flightSalesforce, with agreed translation into Koddi
Execution settings, bids, targeting, and optimizationKoddi
Delivery and performance metricsKoddi
Synchronization status and errorsIntegration service

After conversion, approved commercial changes should update the mapped records. The integration should validate their effect on active media before applying them.

Preserve unrelated metadata during updates. Repeated events and retries should resolve the existing mapping before attempting another create. If a request times out, determine whether creation succeeded before resending it.

Track partial completion so a failed IO association or Salesforce writeback can resume without recreating the advertiser, media plan, or campaigns.

Cancellations, deletions, and Account merges should follow explicit rules that preserve delivery history and mapping records.

Implementation and Validation

Before development, agree on the advertiser onboarding triggers, Account creation rules, Salesforce objects, conversion trigger, field mappings, metadata keys, campaign allocation rules, IO associations, reporting requirements, and synchronization schedule. Your Koddi team can help you.

Validate the integration in a test environment using these acceptance checks:

  • Salesforce-first onboarding creates or links the intended Koddi Advertiser with the correct metadata.
  • On the next daily run, Salesforce retrieves eligible Koddi Advertisers through the member-group Advertisers list endpoint and links each to an existing or newly created Account, as configured. Re-running the sync reuses the same Accounts.
  • A Salesforce Account created through the Koddi-first workflow resolves back to the original Advertiser when Salesforce processes the new Account.
  • Opportunity conversion creates the expected media plan, campaigns, and IOs.
  • Campaigns retain the correct media plan and IO associations.
  • Ad groups are created and managed without requiring Salesforce records.
  • Repeated events and interrupted runs create no duplicates.
  • Approved changes update the existing mapped records.
  • Reporting resolves to the correct Salesforce records and reconciles with Koddi.
  • Missing mappings and failed operations produce visible, actionable exceptions.

FAQ

How does the Salesforce integration work?

The integration connects Salesforce commercial records to Koddi Ads through APIs and metadata. Advertiser onboarding can start in either platform. After the Account and Advertiser are linked, an approved or converted Opportunity creates the associated Media Plan, Campaigns, and IOs. Reporting can flow back to Salesforce as needed.

Can we create the Advertiser in Koddi first?

Yes. Create the Advertiser in Koddi, then Salesforce pulls the member-group Advertisers list on its next daily sync. The sync links an existing Account or creates one if configured. It stores the Salesforce Account ID on the original Advertiser so future Opportunities resolve to it.

Does adding Salesforce IDs to metadata automatically synchronize the platforms?

Metadata provides the relationship between records. An integration service must read changes, call the appropriate APIs, and manage synchronization. This service can run in your existing middleware or another agreed integration environment.

Which Salesforce records map to Koddi objects?

The typical mapping is Account to Advertiser, Opportunity to Media Plan, and Opportunity Products or Order Products to Campaigns. Orders or custom IO records map to Koddi IOs. The final mapping depends on your Salesforce configuration and commercial workflow.

What triggers the creation of a Media Plan, Campaigns, and IOs?

Your implementation defines the trigger, typically when an Opportunity reaches Closed Won or another approved booking status. The integration validates the required account, budget, flight, and commercial information before creating the corresponding Koddi records.

How should Salesforce IDs be stored in Koddi metadata?

Use consistent, explicit keys such as salesforce_account_id, salesforce_opportunity_id, and salesforce_order_item_id. Store IDs as strings using Salesforce's 18-character format. Agree on the keys for each Koddi object before implementation, and preserve unrelated metadata during updates.

Can we link existing Koddi records to Salesforce?

Yes. Start with a mapping exercise to identify the corresponding Salesforce and Koddi records, then populate the agreed metadata fields. Review ambiguous matches before saving them. Use persistent IDs for ongoing synchronization rather than relying on record names.

Can one Salesforce Opportunity create multiple Koddi Campaigns?

Yes. One Opportunity can produce a Media Plan containing multiple Campaigns. A single commercial line may also require multiple Campaigns for different experiences or flight periods. Each Campaign should retain its Salesforce source reference and a distinct execution identifier.

Can one IO be associated with multiple Campaigns?

Yes. An IO can be associated with multiple Campaigns. Store the Salesforce commercial reference in IO metadata and maintain the applicable campaign associations in Koddi. Allocate campaign budgets according to the approved plan rather than copying the full IO amount into every Campaign.

Do we need to create or map Ad Groups in Salesforce?

Generally, no. Ad Groups remain part of Koddi's execution workflow and can be managed through planning workflows, templates, APIs, or media operations. Their delivery can roll up to the parent Campaign, which provides the Salesforce mapping.

Does converting an Opportunity automatically launch advertising?

Only if your integration is explicitly configured to do so. Record creation and media activation should follow the agreed approval workflow. Campaigns must satisfy the applicable creative, targeting, funding, and operational requirements before delivery begins.

How are changes to budgets, dates, or commercial records handled?

Define which system owns each field and which changes are eligible for synchronization. Approved Salesforce changes should update the existing mapped Koddi records. Changes affecting active media should follow the agreed validation and approval process.

How does the integration prevent duplicate records?

Before creating a record, resolve any existing mapping using the stable source ID, whether it comes from Salesforce or Koddi. Use the intended execution identifier when one Salesforce line produces multiple Campaigns. Retried events should resume or update the existing records. If a create request times out, check whether it succeeded before submitting another create request.

Can Koddi reporting data flow back into Salesforce?

Yes. The integration can retrieve reporting through Koddi APIs or use an agreed data lake integration to prepare Salesforce updates. Typical outputs include delivered spend, impressions, clicks, and performance against booked budget. Available metrics, reporting detail, and refresh frequency are agreed during implementation.

How do we reconcile reporting and handle missing mappings?

Join delivery data to the Salesforce references stored in Koddi metadata, then aggregate it to the required Campaign, Media Plan, IO, or Account level. Use consistent dates, currencies, and metric definitions, and keep booked value separate from delivered spend.

Flag missing or conflicting mappings for review. Refresh existing reporting rows when results change, and avoid adding campaign totals to their underlying ad group totals, which would double count delivery.


Did this page help you?