Skip to content

Latest commit

 

History

History
161 lines (120 loc) · 7.5 KB

File metadata and controls

161 lines (120 loc) · 7.5 KB

Google Campaign Manager Operators

Google Campaign Manager operators allow you to insert, run, get or delete reports. For more information about the Campaign Manager report API check official documentation.

Prerequisite Tasks

Deleting a report

To delete Campaign Manager report you can use the ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator. It deletes a report by its unique ID.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDeleteReportOperator parameters which allows you to dynamically determine values.

Downloading a report

The ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator. allows you to download a Campaign Manager to Google Cloud Storage bucket.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerDownloadReportOperator parameters which allows you to dynamically determine values.

Waiting for a report

Report are generated asynchronously. To wait for report to be ready for downloading you can use ~airflow.providers.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.sensors.campaign_manager.GoogleCampaignManagerReportSensor parameters which allows you to dynamically determine values.

Inserting a new report

To insert a Campaign Manager report you can use the ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator. Running this operator creates a new report.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerInsertReportOperator parameters which allows you to dynamically determine values. You can provide report definition using .json file as this operator supports this template extension. The result is saved to XCom <concepts:xcom>, which allows it to be used by other operators.

Running a report

To run Campaign Manager report you can use the ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerRunReportOperator parameters which allows you to dynamically determine values. The result is saved to XCom <concepts:xcom>, which allows it to be used by other operators.

Inserting conversions

To insert Campaign Manager conversions you can use the ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerBatchInsertConversionsOperator.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerBatchInsertConversionsOperator parameters which allows you to dynamically determine values. The result is saved to XCom <concepts:xcom>, which allows it to be used by other operators.

Updating conversions

To update Campaign Manager conversions you can use the ~airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerBatchUpdateConversionsOperator.

/../../tests/system/providers/google/marketing_platform/example_campaign_manager.py

You can use Jinja templating <concepts:jinja-templating> with airflow.providers.google.marketing_platform.operators.campaign_manager.GoogleCampaignManagerBatchUpdateConversionsOperator parameters which allows you to dynamically determine values. The result is saved to XCom <concepts:xcom>, which allows it to be used by other operators.