# Adjust [Adjust](https://www.adjust.com/) is a mobile marketing analytics platform that provides solutions for measuring and optimizing campaigns, as well as protecting user data. omniload supports Adjust as a source. ## URI format The URI format for Adjust is as follows: ```text adjust://?api_key=&lookback_days=40 ``` Parameters: - `api_key`: Required. The API key for the Adjust account. - `lookback_days`: Optional. The number of days to go back than the given start date for data. Defaults to 30 days. An API token is required to retrieve reports from the Adjust reporting API. please follow the guide to [obtain an API key](https://dev.adjust.com/en/api/rs-api/authentication/). Once you complete the guide, you should have an API key. Let's say your API key is `nr_123`, here's a sample command that will copy the data from Adjust into a DuckDB database: ```sh omniload ingest --source-uri 'adjust://?api_key=nr_123' \ --source-table 'campaigns' \ --dest-uri duckdb:///adjust.duckdb \ --dest-table 'adjust.output' ``` The result of this command will be a table in the `adjust.duckdb` database. ### App Token Filtering You can filter data for a specific app by appending `:` to the source table name. Multiple app tokens can be separated by commas: ```sh # Single app token omniload ingest --source-uri 'adjust://?api_key=nr_123' \ --source-table 'campaigns:abc123xyz' \ --dest-uri duckdb:///adjust.duckdb \ --dest-table 'adjust.output' # Multiple app tokens omniload ingest --source-uri 'adjust://?api_key=nr_123' \ --source-table 'campaigns:abc123,def456' \ --dest-uri duckdb:///adjust.duckdb \ --dest-table 'adjust.output' ``` This works for `events`, `campaigns`, and `creatives` tables. For custom tables, use the `app_token__in` filter in the filters section instead (see below). ### Lookback days Adjust data may change going back, which means you'll need to change your start date to get the latest data. The `lookback_days` parameter allows you to specify how many days to go back when calculating the start date, and takes care of automatically updating the start date and getting the past data as well. It defaults to 30 days. ## Tables Adjust source allows ingesting data from various sources: | Table | PK/Merge Key | Inc Key | Inc Strategy | Details | | --------------- | ----------- | --------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | [Events](https://dev.adjust.com/en/api/rs-api/events) | id | – | replace | Retrieves data for [events](https://dev.adjust.com/en/api/rs-api/events/) and event slugs. | | | [campaigns](https://dev.adjust.com/en/api/rs-api/reports) | day | – | merge | Retrieves data for a campaign, showing the app's revenue and network costs over multiple days. `Columns:` campaign, day, app, app_token, store_type, channel, country, network_cost, all_revenue_total_d0, ad_revenue_total_d0, revenue_total_d0, all_revenue_total_d1, ad_revenue_total_d1, revenue_total_d1, all_revenue_total_d3, ad_revenue_total_d3, revenue_total_d3, all_revenue_total_d7, ad_revenue_total_d7, revenue_total_d7, all_revenue_total_d14, ad_revenue_total_d14, revenue_total_d14, all_revenue_total_d21 | | [creatives](https://dev.adjust.com/en/api/rs-api/reports) | day | - | merge | Retrieves data for a creative assets, detailing the app's revenue and network costs across multiple days. `Columns:` campaign, day, app, app_token, store_type, channel, country, adgroup, creative, network_cost, all_revenue_total_d0, ad_revenue_total_d0, revenue_total_d0, all_revenue_total_d1, ad_revenue_total_d1, revenue_total_d1, all_revenue_total_d3, ad_revenue_total_d3, revenue_total_d3, all_revenue_total_d7, ad_revenue_total_d7, revenue_total_d7, all_revenue_total_d14, ad_revenue_total_d14, revenue_total_d14, all_revenue_total_d21 | | `custom` | `configurable` | - | merge | Retrieves custom data based on the dimensions and metrics specified. Please refer to the `custom reports` section below for more information. #### Custom reports: `custom::[:]` The custom table allows you to retrieve data based on specific dimensions and metrics, and apply filters to the data. The format for the custom table is: ```text custom::[:] ``` Parameters: - `dimensions`: A comma-separated list of [dimensions](https://dev.adjust.com/en/api/rs-api/reports#dimensions) to retrieve. - `metrics`: A comma-separated list of [metrics](https://dev.adjust.com/en/api/rs-api/reports#metrics) to retrieve. - `filters`: A comma-separated list of [filters](https://dev.adjust.com/en/api/rs-api/reports#filters) to apply to the data. For example, `app_token__in=abc123` filters results to a specific app. > [!WARNING] > Custom tables require a time-based dimension for efficient operation, such as `hour`, `day`, `week`, `month`, or `year`. ## Examples Copy campaigns data from Adjust into a DuckDB database: ```sh omniload ingest \ --source-uri 'adjust://?api_key=nr_123' \ --source-table 'campaigns' \ --dest-uri duckdb:///adjust.duckdb \ --dest-table 'dest.output' ``` Copy creatives data filtered by app token: ```sh omniload ingest \ --source-uri 'adjust://?api_key=nr_123' \ --source-table 'creatives:abc123xyz' \ --dest-uri duckdb:///adjust.duckdb \ --dest-table 'dest.output' ``` Copy custom data from Adjust into a DuckDB database: ```sh omniload ingest \ --source-uri "adjust://?api_key=nr_123&lookback_days=2" \ --source-table "custom:hour,app,store_id,channel,os_name,country_code,campaign_network,campaign_id_network,adgroup_network,adgroup_id_network,creative_network,creative_id_network:impressions,clicks,cost,network_cost,installs,ad_revenue,all_revenue" \ --dest-uri duckdb:///adjust.db \ --dest-table "mat.example" ``` Copy custom data filtered by app token: ```sh omniload ingest \ --source-uri "adjust://?api_key=nr_123" \ --source-table "custom:day,campaign,app:installs,clicks:app_token__in=abc123xyz" \ --dest-uri duckdb:///adjust.db \ --dest-table "mat.example" ```