CData Python Connector for LinkedIn Marketing Solutions

Build 25.0.9454

Campaigns

Retrieves campaigns in your LinkedIn Ads account by specified status, allowing performance tracking and campaign management.

Table Specific Information

NOTE: The Account column is deprecated and will be removed in the next major version of the connector.

Select

The Campaigns view returns a list of the campaigns that belong to the authenticated user so they can be used as dimensions in analytic requests.

The connector uses the LinkedIn Marketing Solutions API to process search criteria that refer to the Status column. The connector processes other filters client-side within the connector. For example, the following queries are processed server side.

SELECT * FROM Campaigns WHERE Status = 'ACTIVE'

SELECT * FROM Campaigns WHERE AdAccountId = '510013292'

CUD Operations

Insert

To create a new campaign there are some fields that are required in initial creation which are: Account, CampaignGroup, DailyBudgetAmount, DailyBudgetCurrency, Country, Language, Name, OffsiteDeliveryEnabled, ScheduleStartTime, Status, Type, UnitCostAmount, UnitCostCurrency, AdAccountId.

While the following parameters are optional: AssociatedEntity, AudienceExpansionEnabled, CostType, CreativeSelection, ScheduleEndTime, ObjectiveType, ConnectedTelevisionOnly, TimeSpanDuration, TimeSpanUnit, Frequency, OptimizationType, OptimizationTargetType, BlockedIABCategories, AllowedPublisherRestrictionFiles, BlockedPublisherRestrictionFiles.

     "INSERT INTO Campaigns ( Id, Account, CampaignGroup, DailyBudgetAmount, DailyBudgetCurrency, Country, Language, Name, OffsiteDeliveryEnabled, ScheduleStartTime, ScheduleEndTime, Status, Type, UnitCostAmount, UnitCostCurrency, AdAccountId ) VALUES ( 'camp789', 'urn:li:sponsoredAccount:515218099', 'urn:li:sponsoredCampaignGroup:756063323', '150.00', 'USD', 'US', 'en', 'Spring Lead Generation 4', FALSE, '2025-07-01 09:00:00', '2025-07-31 23:59:59', 'DRAFT', 'TEXT_AD', '2.50', 'USD', '515218099' );"
 

Update

To modify an existing campaign group, use an UPDATE statement. Note that the Id and AdAccountId columns are required in the WHERE clause.

The following columns are the ones that are mutable after creation: CampaignGroup, AssociatedEntity, AudienceExpansionEnabled, CostType, CreativeSelection, DailyBudgetAmount, DailyBudgetCurrency, Country, Language, Name, OffsiteDeliveryEnabled, ScheduleStartTime, ScheduleEndTime, Status, UnitCostAmount, UnitCostCurrency, ObjectiveType, TimeSpanDuration, TimeSpanUnit, Frequency, OptimizationType, OptimizationTargetType, BlockedIABCategories, AllowedPublisherRestrictionFiles, BlockedPublisherRestrictionFiles.

     "UPDATE Campaigns SET Account = 'urn:li:sponsoredAccount:515218099', CampaignGroup = 'urn:li:sponsoredCampaignGroup:756063323', AssociatedEntity = 'urn:li:organization:101877555', AudienceExpansionEnabled = TRUE, CostType = 'CPM', CreativeSelection = 'OPTIMIZED', DailyBudgetAmount = '250.00', DailyBudgetCurrency = 'USD', Country = 'GB', Language = 'en', Name = 'Updated Campaign Name', OffsiteDeliveryEnabled = FALSE, ScheduleStartTime = '2025-07-15 09:00:00', ScheduleEndTime = '2025-08-15 18:00:00', Status = 'PAUSED', Type = 'SPONSORED_UPDATES', UnitCostAmount = '2.75', UnitCostCurrency = 'USD', ConnectedTelevisionOnly = TRUE, TimeSpanDuration = 7, TimeSpanUnit = 'DAY', Frequency = 3, OptimizationType = 'MAX_FREQUENCY', BlockedIABCategories = 'urn:li:iabCategory:IAB4-2,urn:li:iabCategory:IAB17-31', AllowedPublisherRestrictionFiles = 'urn:li:adPublisherFile:1359990,urn:li:adPublisherFile:1360990', BlockedPublisherRestrictionFiles = 'urn:li:adPublisherFile:1359991,urn:li:adPublisherFile:1361990' WHERE Id = '403469283' and AdAccountId = '515218099'"
 

Delete

To remove a campaign, use a DELETE statement. Note that the Id and AdAccountId columns are required in the WHERE clause.

 DELETE FROM Campaigns WHERE Id = 123456789 AND AdAccountId = '123456789';
 

Columns

Name Type ReadOnly References Description
Id [KEY] String True

Unique numerical identifier assigned to the campaign.

Account String False

Uniform Resource Name (URN) that identifies the advertising account associated with the campaign.

CampaignGroup String False

Numerical identifier of the campaign group that the campaign belongs to.

AssociatedEntity String False

URN that identifies a related object, with the specific meaning depending on the campaign type (for example, a creative or targeting entity).

AudienceExpansionEnabled Boolean False

Identifies whether or not Audience Expansion is enabled, allowing LinkedIn to broaden targeting by including members with similar attributes to the defined audience.

CostType String False

Specifies the campaign's pricing model: cost-per-click (CPC) or cost-per-impression (CPM).

The allowed values are CPM, CPC, CPV.

CreativeSelection String False

Determines how creatives are rotated or prioritized. ROUND_ROBIN evenly rotates creatives, while OPTIMIZED favors those expected to perform better.

DailyBudgetAmount String False

Specifies the campaign's daily spending limit as a real number string.

DailyBudgetCurrency String False

Currency code defined by the ISO that specifies the currency for the daily budget.

Country String False

Specifies the country where the campaign is served, using an uppercase two-letter code defined by ISO 3166.

Language String False

Specifies the campaign language using a lowercase two-letter code defined by '.

Name String False

Name assigned to the campaign, used to identify it in reports and within the account.

OffsiteDeliveryEnabled Boolean False

Identifies whether or not the campaign is allowed to serve ads on the LinkedIn Audience Network beyond the LinkedIn platform.

ScheduleStartTime Datetime False

Start date and time when the campaign becomes active and eligible to serve ads.

ScheduleEndTime Datetime False

End date and time when the campaign is scheduled to stop serving ads.

Status String False

Indicates the current operational status of the campaign.

The allowed values are ACTIVE, ARCHIVED, COMPLETED, CANCELED, DRAFT, PAUSED, PENDING_DELETION, REMOVED.

Type String False

Specifies the campaign type.

The allowed values are TEXT_AD, SPONSORED_UPDATES, SPONSORED_INMAILS, DYNAMIC.

UnitCostAmount String False

Specifies the bid amount per click, impression, or other event, depending on the campaign's pricing model.

UnitCostCurrency String False

Specifies the currency used for the bid amount, matching the account's currency settings.

ObjectiveType String False

Defines the primary objective of the campaign.

The allowed values are BRAND_AWARENESS, ENGAGEMENT, JOB_APPLICANTS, LEAD_GENERATION, WEBSITE_CONVERSIONS, WEBSITE_VISITS, VIDEO_VIEWS.

AdAccountId String False

Unique identifier of the advertising account linked to the campaign.

ConnectedTelevisionOnly Boolean False

Identifies whether or not the campaign is designated as a Connected Television (CTV)–only campaign, meaning ads are shown exclusively on connected TV devices.

TimeSpanDuration Integer False

Specifies the numerical duration value for the campaign's time span.

TimeSpanUnit String False

Specifies the time unit associated with the campaign's duration, such as days or weeks.

Frequency Integer False

Defines how many times a campaign's ad is shown to the same member within a given period.

OptimizationType String False

Specifies the optimization strategy applied to control ad frequency and performance.

OptimizationTargetType String False

Defines how the campaign is optimized for spending or outcomes. If not set, no optimization strategy is applied.

The allowed values are NONE, ENHANCED_CONVERSION, TARGET_COST_PER_CLICK, TARGET_COST_PER_IMPRESSION, TARGET_COST_PER_VIDEO_VIEW, CAP_COST_AND_MAXIMIZE_CLICKS, CAP_COST_AND_MAXIMIZE_IMPRESSIONS, CAP_COST_AND_MAXIMIZE_VIDEO_VIEWS, MAX_REACH, MAX_LEAD, MAX_VIDEO_VIEW, MAX_CONVERSION, MAX_CLICK, MAX_IMPRESSION.

BlockedIABCategories String False

Lists Interactive Advertising Bureau (IAB) mobile application categories that are blocked from serving this campaign's ads off-network.

AllowedPublisherRestrictionFiles String False

Lists publisher restriction files that define which off-network sites are approved to serve the campaign's ads.

BlockedPublisherRestrictionFiles String False

Lists publisher restriction files that define which off-network sites are prohibited from serving the campaign's ads.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9454