SavedAudienceTemplates
Read and write saved audience targeting templates in your ad-accounts.
Table Specific Information
To learn more about the format of the JSON object in the TargetingCriteria column, refer to LinkedIn's API documentation.Select
For the AccountURN column, the = operator is fully supported server-side. The IN operator is partially supported server-side and partially client-side. Refer to the query examples below:SELECT * FROM SavedAudienceTemplates WHERE AccountURN = 'urn:li:sponsoredAccount:512859024';
SELECT * FROM SavedAudienceTemplates WHERE AccountURN IN ('urn:li:sponsoredAccount:512859024', 'urn:li:sponsoredAccount:513009855')
When no criteria are specified, as in the statement below:
SELECT * FROM SavedAudienceTemplates;
We internally post-process the query to the following before executing:
SELECT * FROM SavedAudienceTemplates WHERE AccountURN IN (SELECT URN FROM Accounts);
The rest of the query is processed client-side.
Insert
To create a new record, use an INSERT statement.The following columns are required for this operation:
- AccountURN
- Name
- TargetingCriteria
INSERT INTO SavedAudienceTemplates (AccountURN, Name, Description, TargetingCriteria)
VALUES ('urn:li:sponsoredAccount:515565126', 'Saved Template 1', 'Saved Template 1',
'{
"include": {
"and": [
{
"or": {
"urn:li:adTargetingFacet:locations": [
"urn:li:geo:90000034",
"urn:li:geo:104079912"
]
}
},
{
"or": {
"urn:li:adTargetingFacet:titles": [
"urn:li:title:1",
"urn:li:title:107"
]
}
}
]
},
"exclude": {
"or": {
"urn:li:adTargetingFacet:degrees": [
"urn:li:degree:1000",
"urn:li:degree:1100"
]
}
}
}');
Update
To modify a record, use an UPDATE statement. The Id column is required in the WHERE clause.The following columns are the ones that are mutable after creation:
- Name
- Description
- TargetingCriteria
UPDATE SavedAudienceTemplates
SET Name = 'My Audience Template 1', Description = 'My Audience Template 1', TargetingCriteria =
'{
"include": {
"and": [
{
"or": {
"urn:li:adTargetingFacet:locations": [
"urn:li:geo:90000033",
"urn:li:geo:104079911"
]
}
},
{
"or": {
"urn:li:adTargetingFacet:titles": [
"urn:li:title:2",
"urn:li:title:106"
]
}
}
]
},
"exclude": {
"or": {
"urn:li:adTargetingFacet:degrees": [
"urn:li:degree:1000",
"urn:li:degree:1100"
]
}
}
}' WHERE Id = '42481729';
Delete
To delete a record, use a DELETE statement. The Id column is required in the WHERE clause.DELETE FROM SavedAudienceTemplates WHERE Id = '42481729'
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | String | True |
The unique template identifier. | |
| Name | String | False |
The template name, max 100 characters. | |
| Description | String | False |
The template description, max 500 characters. | |
| ApproximateReach | Long | True |
The estimated number of targetable LinkedIn members. | |
| TargetingCriteria | String | False |
The targeting facets criteria matching the targeted audience. Represented in JSON format. | |
| AccountURN | String | False |
The URN of the associated ad-account in which the targeting template is saved at. | |
| CreatedAt | Datetime | True |
The timestamp when the template was created. | |
| UpdatedAt | Datetime | True |
The timestamp when the template was last modified. |