This is a Singer tap that produces JSON-formatted data following the Singer spec.
This tap:
-
Pulls raw data from the Criteo Marketing API
-
Extracts the following resources from Criteo for a one or more advertisers:
-
Outputs the schema for each resource
-
Incrementally pulls data based on the input state
We recommend using a virtualenv:
> virtualenv -p python3 venv
> source venv/bin/activate
> pip install tap-criteo
To use the Criteo Marketing API, you must create an API user. https://support.criteo.com/s/article?article=360001285145-Getting-Started
The Criteo Tap will use the client_id
and client_secret
obtained from the previous step. Additionally you will need:
start_date - an initial date for the Tap to extract Criteo data
The following is an example of the minimum required configuration
{"client_id": "",
"client_secret": "",
"start_date": ""}
Optionally, you may define the following keys in the configuration
end_date - used to only pull data up to a given date
user_agent - used in requests made to the Criteo Marketing API
advertiser_ids - A comma-separated list of Criteo advertiser IDs which you wish to replicate data from. If not defined then all avertiser IDs will be replicated.
The catalog file will indicate what streams and fields to replicate from the Criteo Marketing API. The Tap takes advantage of the Singer best practices for schema discovery and catalog selection.
You can provide JSON file that contains a date for the streams to force the application to only fetch data newer than those dates. If you omit the file it will fetch all data for the selected streams.
{"campaign_performance_12345":"2017-01-01T00:00:00Z",
"CampaignPerformance":"2017-01-01T00:00:00Z",
"FacebookDPA":"2017-01-01T00:00:00Z"}
tap-criteo -c config.json --catalog catalog.json -s state.json
tap-criteo uses some custom metadata keys for some endpoints:
currency
- The currency to be used in the report. Three-letter capitals. For a list of possible values, please see the full documentation. Defaults to USD.ignoreXDevice
- Ignore cross-device data. Also can explicitly set to null for TransactionID ReportType to get all data. Defaults to false.
col-name
- This is the CSV header that Criteo returns for this piece of data and is used to parse the CSV.behaviour
- Either metric or dimension. As defined by Criteo's documentation. If neither metric or dimension fields are listed asannotation
, these fields are returned but cannot be specifically requested.fieldExclusions
- Indicates which other fields may not be selected when this field is selected. If you invoke the tap with selections that violate fieldExclusion rules, the tap will fail.
clickAttributionPolicy
- Specify the click attribution policy for salesUnits, revenue, CR, CPO, COS, and ROAS (sameSeller
oranySeller
)
behaviour
- Either metric or dimension. As defined by Criteo's documentationfieldExclusions
- Indicates which other fields may not be selected when this field is selected. If you invoke the tap with selections that violate fieldExclusion rules, the tap will fail.
Copyright © 2019 Stitch