airflow.providers.google.marketing_platform.hooks.campaign_manager

This module contains Google Campaign Manager hook.

Module Contents

class airflow.providers.google.marketing_platform.hooks.campaign_manager.GoogleCampaignManagerHook(api_version: str = 'v3.3', gcp_conn_id: str = 'google_cloud_default', delegate_to: Optional[str] = None, impersonation_chain: Optional[Union[str, Sequence[str]]] = None)[source]

Bases: airflow.providers.google.common.hooks.base_google.GoogleBaseHook

Hook for Google Campaign Manager.

get_conn(self)[source]

Retrieves connection to Campaign Manager.

delete_report(self, profile_id: str, report_id: str)[source]

Deletes a report by its ID.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report_id (str) -- The ID of the report.

insert_report(self, profile_id: str, report: Dict[str, Any])[source]

Creates a report.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report (Dict[str, Any]) -- The report resource to be inserted.

list_reports(self, profile_id: str, max_results: Optional[int] = None, scope: Optional[str] = None, sort_field: Optional[str] = None, sort_order: Optional[str] = None)[source]

Retrieves list of reports.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • max_results (Optional[int]) -- Maximum number of results to return.

  • scope (Optional[str]) -- The scope that defines which results are returned.

  • sort_field (Optional[str]) -- The field by which to sort the list.

  • sort_order (Optional[str]) -- Order of sorted results.

patch_report(self, profile_id: str, report_id: str, update_mask: dict)[source]

Updates a report. This method supports patch semantics.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report_id (str) -- The ID of the report.

  • update_mask (Dict) -- The relevant portions of a report resource, according to the rules of patch semantics.

run_report(self, profile_id: str, report_id: str, synchronous: Optional[bool] = None)[source]

Runs a report.

Parameters
  • profile_id (str) -- The DFA profile ID.

  • report_id (str) -- The ID of the report.

  • synchronous (Optional[bool]) -- If set and true, tries to run the report synchronously.

update_report(self, profile_id: str, report_id: str)[source]

Updates a report.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report_id (str) -- The ID of the report.

get_report(self, file_id: str, profile_id: str, report_id: str)[source]

Retrieves a report file.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report_id (str) -- The ID of the report.

  • file_id (str) -- The ID of the report file.

get_report_file(self, file_id: str, profile_id: str, report_id: str)[source]

Retrieves a media part of report file.

Parameters
  • profile_id (str) -- The DFA user profile ID.

  • report_id (str) -- The ID of the report.

  • file_id (str) -- The ID of the report file.

Returns

googleapiclient.http.HttpRequest

conversions_batch_insert(self, profile_id: str, conversions: List[Dict[str, Any]], encryption_entity_type: str, encryption_entity_id: int, encryption_source: str, max_failed_inserts: int = 0)[source]

Inserts conversions.

Parameters
  • profile_id (str) -- User profile ID associated with this request.

  • conversions (List[Dict[str, Any]]) -- Conversations to insert, should by type of Conversation: https://developers.google.com/doubleclick-advertisers/v3.3/conversions#resource

  • encryption_entity_type (str) -- The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_entity_id (int) -- The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_source (str) -- Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer.

  • max_failed_inserts (int) -- The maximum number of conversions that failed to be inserted

conversions_batch_update(self, profile_id: str, conversions: List[Dict[str, Any]], encryption_entity_type: str, encryption_entity_id: int, encryption_source: str, max_failed_updates: int = 0)[source]

Updates existing conversions.

Parameters
  • profile_id (str) -- User profile ID associated with this request.

  • conversions (List[Dict[str, Any]]) -- Conversations to update, should by type of Conversation: https://developers.google.com/doubleclick-advertisers/v3.3/conversions#resource

  • encryption_entity_type (str) -- The encryption entity type. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_entity_id (int) -- The encryption entity ID. This should match the encryption configuration for ad serving or Data Transfer.

  • encryption_source (str) -- Describes whether the encrypted cookie was received from ad serving (the %m macro) or from Data Transfer.

  • max_failed_updates (int) -- The maximum number of conversions that failed to be updated

Was this entry helpful?