Skip to main content

Campaigns

The Call Tracking Campaigns page lists your marketing campaigns and their tracking numbers. A campaign assigns phone numbers to a marketing initiative, routes inbound calls to a destination of your choice, and attributes calls to sources, mediums, and campaigns for analytics and conversion tracking. Open it from Call Tracking → Campaigns.

Call Tracking Campaigns list with a search box, status filter and New Campaign button, showing two active campaigns with their source, medium, destination type, tracking number count and a delete action

Purpose​

Use this module to:

  • Create campaigns that represent marketing channels or initiatives
  • Assign one or more DIDs to each campaign as tracking numbers
  • Route inbound calls to external numbers or existing OPBX destinations
  • Define conversion rules based on call duration and disposition
  • Send converted calls to Google Ads and Meta for offline attribution
  • Deliver webhook notifications for call events

Campaigns​

A campaign groups together a source (for example, google), a medium (for example, cpc), a routing destination, and conversion rules. When a call arrives on a tracking number assigned to a campaign, OPBX creates a session and attributes it to that campaign.

Campaign Status​

StatusBehavior
ActiveCalls are tracked, routed, and reported
InactiveThe campaign is ignored; calls to its tracking numbers are not attributed

Set a campaign to Inactive when you are not currently running the associated marketing initiative.

Destination Types​

Each campaign defines where inbound calls are sent.

Destination TypeConfig FieldBest For
Forwardforward_toRoute to any external E.164 number
Extensionextension_idRoute to a specific user extension
Ring Groupring_group_idDistribute across a department
Business Hoursbusiness_hours_schedule_idTime-based open/closed routing
Conference Roomconference_room_idDedicated conference bridge
IVR Menuivr_menu_idAutomated menu routing
AI Assistantai_assistant_idAI voice agent handling
AI Load Balancerai_load_balancer_idDistributed AI agent routing
tip

The campaign form in the web UI exposes Forward, Extension, and Ring Group by default. All destination types are available through the API.

DNI and Number Assignment​

Dynamic Number Insertion (DNI) swaps the phone number displayed on your website based on the visitor's UTM parameters. See DNI Snippet for installation instructions.

Assign a Tracking Number​

Campaign detail page for Fall Promo - Search Ads showing source and medium, an active status and ring_group destination badge, Edit and Delete buttons, and the Tracking Numbers tab with one active number and an Add Number button
  1. Open a campaign and select the Tracking Numbers tab
  2. Click Add Number
  3. Choose an existing DID from the Phone Numbers module
  4. Enter an optional friendly name (for example, "Google Ads — San Francisco")
  5. Save

When you assign a DID to a campaign, OPBX updates the DID's routing type to call_tracking and points it at the campaign. You can assign multiple numbers to one campaign or dedicate one number per campaign.

Tracking Number Status​

StatusBehavior
ActiveEligible for DNI swaps and routes calls to the campaign
InactiveIgnored by DNI swaps; calls are still routed by the DID configuration

Conversion Rules​

A conversion rule decides whether a tracked call counts as a conversion.

FieldDefaultDescription
Require answered dispositiontrueOnly CONNECTED or ANSWERED dispositions can convert
Min answered duration (seconds)30The call must last at least this many billable seconds
Conversion valuenoneOptional monetary value attached to each conversion

OPBX evaluates the rule when a session is created from a Call Detail Record (CDR). If the call meets all enabled conditions, is_converted is set to true and the configured conversion value is stored on the session.

Ad-Platform Uploads​

Each campaign has its own Google Ads and Meta upload toggles. Uploads also need the organization-wide credentials set on the Integrations page.

Notification Settings​

Each campaign can send webhook notifications for call events. Configure them on the Notifications tab of the campaign detail page.

Notifications tab of a campaign with Webhook URL, Authentication set to None, Enabled Events checkboxes for Call Received, Call Answered, Call Completed and Call Converted, an Active toggle, and Save Settings and Test Webhook buttons

Supported Events​

EventFired When
call.receivedA call is received on a tracking number
call.answeredThe call is answered
call.completedThe call ends
call.convertedThe call meets the conversion rule

Authentication​

MethodBehavior
NoneNo authentication header is sent
Bearer TokenSends Authorization: Bearer <token>
Basic AuthSends Authorization: Basic <username:password>
tip

Use the Test Webhook button to send a sample call.received payload and verify connectivity. Authorization headers are redacted in the delivery log.

Webhook Payload​

{
"event": "call.converted",
"event_id": "uuid",
"timestamp": "2026-06-25T12:34:56+00:00",
"organization_id": 1,
"campaign": { "id": 5, "name": "Google Ads — HVAC" },
"tracking_number": "+14155551234",
"caller_number": "+14155559876",
"source": "google",
"medium": "cpc",
"duration": 87,
"billsec": 72,
"is_answered": true,
"is_converted": true,
"conversion_value": 45.0
}

Permissions​

ActionOwnerPBX AdminPBX UserReporter
View campaignsYesYesYesYes
Create campaignsYesYesNoNo
Update campaignsYesYesNoNo
Delete campaignsYesYesNoNo
View tracking numbersYesYesYesYes
Create tracking numbersYesYesNoNo
Update tracking numbersYesYesNoNo
Delete tracking numbersYesYesNoNo

Configuring the ad-platform credentials is covered on the Integrations page.

UI Workflow​

Create a Campaign​

New Campaign form with Basic Information (Name, Source, Medium), Destination (Destination Type Forward to Number and Forward To), Ad-Platform Uploads toggles for Google Ads and Meta Conversions, and Conversion Rules with Min Answered Duration, Conversion Value and Require answered disposition
  1. Navigate to Call Tracking → Campaigns
  2. Click New Campaign
  3. Enter a campaign name
  4. Optionally enter a source and medium for attribution
  5. Choose a destination type and fill in the destination details
  6. Set conversion rules
  7. Enable Google Ads or Meta uploads if desired
  8. Save the campaign

Add a Tracking Number​

  1. Open the campaign detail page
  2. Select the Tracking Numbers tab
  3. Click Add Number
  4. Select a DID and enter an optional friendly name
  5. Save

Configure Webhooks​

  1. Open the campaign detail page
  2. Select the Notifications tab
  3. Enter the webhook URL
  4. Choose an authentication method
  5. Select the events to send
  6. Save and test the webhook

Delete a Campaign​

  1. Click the delete icon in the Actions column of the campaign list, or Delete on the campaign detail page
  2. Confirm in the Delete Campaign dialog

The dialog warns that the action cannot be undone.

Delete Campaign confirmation dialog asking whether to delete Partner Newsletter and warning that the action cannot be undone, with Cancel and Delete buttons

Key Data Fields​

call_tracking_campaigns Table​

ColumnTypeNotes
idbigintPrimary key
organization_idFKTenant scope
namestringCampaign display name
sourcestring nullableAttribution source, e.g. google
mediumstring nullableAttribution medium, e.g. cpc
descriptiontext nullableOptional description
statusenumactive or inactive
destination_typeenumforward, extension, ring_group, business_hours, conference_room, ivr_menu, ai_assistant, ai_load_balancer
destination_configJSON{forward_to: "..."}, {extension_id: N}, etc.
conversion_ruleJSON{min_answered_duration_seconds, requires_answered_disposition, conversion_value}
google_ads_upload_enabledbooleanUpload converted calls to Google Ads
meta_upload_enabledbooleanSend converted calls to Meta

call_tracking_numbers Table​

ColumnTypeNotes
idbigintPrimary key
organization_idFKTenant scope
call_tracking_campaign_idFKParent campaign
did_number_idFKLinked DID
friendly_namestring nullableDisplay label
statusenumactive or inactive
MethodEndpointPurpose
GET/v1/call-tracking-campaignsList campaigns
POST/v1/call-tracking-campaignsCreate campaign
GET/v1/call-tracking-campaigns/{campaign}Get campaign
PUT/v1/call-tracking-campaigns/{campaign}Update campaign
DELETE/v1/call-tracking-campaigns/{campaign}Delete campaign
GET/v1/call-tracking-campaigns/{campaign}/call-tracking-numbersList tracking numbers
POST/v1/call-tracking-campaigns/{campaign}/call-tracking-numbersAdd tracking number
PUT/v1/call-tracking-campaigns/{campaign}/call-tracking-numbers/{number}Update tracking number
DELETE/v1/call-tracking-campaigns/{campaign}/call-tracking-numbers/{number}Remove tracking number
GET/v1/call-tracking-campaigns/{campaign}/notification-settingsGet notification settings
PUT/v1/call-tracking-campaigns/{campaign}/notification-settingsUpdate notification settings
POST/v1/call-tracking-campaigns/{campaign}/notification-settings/testTest webhook
GET/v1/call-tracking-campaigns/{campaign}/notification-logsView delivery logs

The ad-platform credentials endpoint is listed on the Integrations page. See the OPBX REST API reference for full schemas.

Best Practices​

  • Use consistent source and medium values that match your UTM parameters
  • Assign a unique tracking number per campaign for clean attribution
  • Set conversion rules that match your business definition of a qualified lead
  • Test webhook notifications before enabling them in production
  • Review notification logs regularly to catch delivery failures