Plugin Basics

When the wizard is first run with valid credentials, it contacts the AAAPI and obtains all current profile ids in the account. For each profile id, the user then chooses the report type(s) and snapshot type(s) necessary to obtain the desired data. When the wizard finishes, the Mitto jobs necessary to obtain the data have been created and are available for use in Mitto.

One top-level job, “Amazon Advertising: Profiles” collects information on all profiles in the account. The information is stored in the Postgres schema / table amazon_advertising.profiles. The profiles table is the only table in this schema.

The remaining jobs are per-profile jobs, with a set of these jobs belonging to each profile.

Per-Profile Jobs

Each profile has a “Amazon Advertising: Portfolios” job that collects information about the portfolios owned by the profile.

The remaining jobs belonging to a profile request, download, and import either reports or snapshots.

Job Naming

Job names generally correspond to a combination of the Postgres schema name and table name associated with the data. See Data Model for more information on the Postgres schema name and table names used.

The following job name would be used for the “Sponsored Products Report: Ad Groups” for the fictional Max Technology company illustrated in Data Model:

amazon_advertising__max_technology_123456788901__sponsored_products_report__ad_groups

Job Ordering

Jobs can be run in any order desired.

Reports

AAAPI reports are the source of all metrics collected by the plugin. A single report covers one 24-hour period for one profile. Reports can be obtained for any date up to 60 days in the past. Thus, when the plugin is first used, at-most sixty days of historical data can be loaded.

Timezones

In processing reports, AAAPI uses the timezone associated with a profile. Thus, it is possible for report data in Mitto to be in different timezones. When obtaining data from the AAAPI, the plugin automatically uses the correct timezone for the profile associated with the job.

Data Added by the Plugin

Reports

The AmazonAdvertisingReportCreateAndLoad inputter adds three fields to report data when it is loaded: profile_id and date, and run_date. profile_id is the profile id of the associated profile. date is the date associated with the data. run_date is the date on which the report was run.

Snapshots

The AmazonAdvertisingSnapshotCreateAndLoad inputter adds two fields to report data when it is loaded: profile_id and date. profile_id is the profile id of the associated profile. date is the date associated with the data.

Downloaded Data

When reports and snapshots are downloaded from AAAPI, they are stored in /var/mitto/data/reports/amazon_advertising before they are loaded into Mitto. Reports and snapshots in this directory remain there until manually removed. See Inputters Configuration for examples of loading data from existing reports and snapshots.