Tableau Connector for Twitter Ads

Build 21.0.7930

AdAudiences

Retrieve details for some or all Tailored Audiences associated with the current account.

View Specific Information

Select

Only the Id filter is supported.

SELECT * FROM AdAudiences WHERE Id = 'TXR1'

Insert

This table supports simple Insert and batch Insert operations.

Simple Insert:

INSERT INTO [AdAudiences] (name) VALUES ('test')

Batch Insert:

Batch inserts are used to generate a new audience based on existing audiences and by setting a couple of conditions on them.

For example: To create a new audience based on the most active users of X1 AND (X2 or X3) audience the structure would be like this:

INSERT INTO a#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYIF', 1, 'NUM_GT', 30, true)

INSERT INTO b#temp (TailoredAudienceId, lookbackWindow) VALUES ('TXR1', 30)

INSERT INTO c#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYFO', 1, 'NUM_GT', 30, true)

INSERT INTO AdAudiences#temp (audienceType, name, segments) VALUES ('FLEXIBLE', 'Test1', 'a#temp and (b#temp or c#temp)')

INSERT INTO [AdAudiences] (audienceType, name, segments) SELECT audienceType, name, segments FROM [AdAudiences#Temp]

Make sure to set the required columns on initial temp tables, for example a#temp, which are: TailoredAudienceId and LookbackWindow.

Values that are set in these temp table will be used by AdAudiences#temp in the Segments column, which will be used as a criteria, combined with AND/OR logical operators.

Update

This table supports simple and batch Update operations.

Simple Update:

UPDATE [AdAudiences] SET Name='testModified' where Name='test'

Batch Update:

Batch updates are used to modify an existing audience by setting a couple of new conditions on it.

For example: To modify an audience based on the most active users of X1 AND (X2 or X3) audience the structure would be like this:

INSERT INTO a#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYIF', 1, 'NUM_GT', 30, true)

INSERT INTO b#temp (TailoredAudienceId, lookbackWindow) VALUES ('TXR1', 30)

INSERT INTO c#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYFO', 1, 'NUM_GT', 30, true)

INSERT INTO AdAudiences#temp (audienceType, name, segments) VALUES ('FLEXIBLE', 'Test1', 'a#temp and (b#temp or c#temp)')

UPDATE [AdAudiences] (audienceType, name, segments) SELECT audienceType, name, segments FROM [AdAudiences#Temp]

Delete

This table supports simple and batch Delete operations.

Simple Delete:

DELETE FROM [AdAudiences] WHERE Name='test'

Batch Delete:

INSERT INTO a#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYIF', 1, 'NUM_GT', 30, true)

INSERT INTO b#temp (TailoredAudienceId, lookbackWindow) VALUES ('TXR1', 30)

INSERT INTO c#temp (TailoredAudienceId, frequency, frequencyComparator, lookbackWindow, negate) VALUES ('TYFO', 1, 'NUM_GT', 30, true)

INSERT INTO AdAudiences#temp (audienceType, name, segments) VALUES ('FLEXIBLE', 'Test1', 'a#temp and (b#temp or c#temp)')

DELETE FROM [AdAudiences] WHERE EXISTS SELECT audienceType, name, segments FROM [AdAudiences#Temp]

Columns

Name Type ReadOnly Description
Id [KEY] String True

The unique identifier of the ad tailored audience.

AccountId String False

Id of the advertising account to work with.

OwnerAccountId String True

The unique identifier of the owner account.

Name String False

The name of the tailored audience.

AudienceSize Integer True

The size of the tailored audience.

AudienceType String True

The type of the tailored audience.

CreatedAt Datetime True

The time of the creation of this audience.

UpdatedAt Datetime True

The time of the last change of the properties of this audience.

PartnerSource String True

The partner source of this tailored audience.

PermissionLevel String True

The permission level of this tailored audience.

ReasonsNotTargetable String True

The reasons why this audience is not targetable, if it is not targetable.

TargetableTypes String True

Targetable types of the audience.

Targetable Boolean True

Shows if the audience is targetable or not.

Deleted Boolean True

Whether the audience is deleted.

Segments String True

Useful only in Batch Insert, Update and Delete operations.

Pseudo-Columns

Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.

Name Type Description
IncludeDeleted String

Boolean used for including or not the deleted accounts.

The default value is false.

Copyright (c) 2021 CData Software, Inc. - All rights reserved.
Build 21.0.7930