diff --git a/colabs/itp_audit.ipynb b/colabs/itp_audit.ipynb index b1b32695..59ee18e6 100644 --- a/colabs/itp_audit.ipynb +++ b/colabs/itp_audit.ipynb @@ -97,12 +97,12 @@ "source": [ "FIELDS = {\n", " 'recipe_timezone': 'America/Los_Angeles', # Timezone for report dates.\n", + " 'recipe_name': '', # Name of document to deploy to.\n", " 'cm_account_id': '', # Campaign Manager Account Id.\n", + " 'cm_advertiser_ids': '', # Optional: Comma delimited list of CM advertiser ids.\n", " 'floodlight_configuration_id': '', # Floodlight Configuration Id for the Campaign Manager floodlight report.\n", - " 'cm_advertiser_ids': '', # Optional: Comma delimited list of DCM advertiser ids.\n", " 'dv360_partner_ids': '', # Comma delimited list of DV360 Partner ids.\n", " 'dv360_advertiser_ids': '', # Optional: Comma delimited list of DV360 Advertiser ids.\n", - " 'recipe_name': '', # Name of document to deploy to.\n", "}\n", "\n", "print(\"Parameters Set To: %s\" % FIELDS)\n" @@ -137,14 +137,14 @@ " ],\n", " 'copy': {\n", " 'source': 'https://docs.google.com/spreadsheets/d/1rH_PGXOYW2mVdmAYnKbv6kcaB6lQihAyMsGtFfinnqg/',\n", - " 'destination': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}}\n", + " 'destination': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}}\n", " }\n", " }\n", " },\n", " {\n", " 'dataset': {\n", " 'auth': 'user',\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}}\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}}\n", " }\n", " },\n", " {\n", @@ -154,16 +154,16 @@ " 'timeout': 90,\n", " 'filters': {\n", " 'FILTER_ADVERTISER': {\n", - " 'values': {'field': {'name': 'dv360_advertiser_ids','kind': 'integer_list','order': 5,'default': '','description': 'Optional: Comma delimited list of DV360 Advertiser ids.'}}\n", + " 'values': {'field': {'name': 'dv360_advertiser_ids','kind': 'integer_list','order': 6,'default': '','description': 'Optional: Comma delimited list of DV360 Advertiser ids.'}}\n", " },\n", " 'FILTER_PARTNER': {\n", - " 'values': {'field': {'name': 'dv360_partner_ids','kind': 'integer_list','order': 4,'default': '','description': 'Comma delimited list of DV360 Partner ids.'}}\n", + " 'values': {'field': {'name': 'dv360_partner_ids','kind': 'integer_list','order': 5,'default': '','description': 'Comma delimited list of DV360 Partner ids.'}}\n", " }\n", " },\n", " 'body': {\n", " 'timezoneCode': {'field': {'name': 'recipe_timezone','kind': 'timezone','description': 'Timezone for report dates.','default': 'America/Los_Angeles'}},\n", " 'metadata': {\n", - " 'title': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Browser_','order': 7,'description': 'Name of report in DBM, should be unique.'}},\n", + " 'title': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Browser_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n", " 'dataRange': 'LAST_365_DAYS',\n", " 'format': 'CSV'\n", " },\n", @@ -206,10 +206,10 @@ " 'auth': 'user',\n", " 'report': {\n", " 'timeout': 90,\n", - " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 1,'default': '','description': 'Campaign Manager Account Id.'}},\n", + " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 2,'default': '','description': 'Campaign Manager Account Id.'}},\n", " 'body': {\n", " 'kind': 'dfareporting#report',\n", - " 'name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Floodlight_','order': 7,'description': 'Name of report in DBM, should be unique.'}},\n", + " 'name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Floodlight_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n", " 'format': 'CSV',\n", " 'type': 'FLOODLIGHT',\n", " 'floodlightCriteria': {\n", @@ -220,7 +220,7 @@ " 'floodlightConfigId': {\n", " 'kind': 'dfareporting#dimensionValue',\n", " 'dimensionName': 'dfa:floodlightConfigId',\n", - " 'value': {'field': {'name': 'floodlight_configuration_id','kind': 'integer','order': 2,'default': '','description': 'Floodlight Configuration Id for the Campaign Manager floodlight report.'}},\n", + " 'value': {'field': {'name': 'floodlight_configuration_id','kind': 'integer','order': 4,'default': '','description': 'Floodlight Configuration Id for the Campaign Manager floodlight report.'}},\n", " 'matchType': 'EXACT'\n", " },\n", " 'reportProperties': {\n", @@ -279,7 +279,7 @@ " },\n", " 'out': {\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Floodlight_CM_Report',\n", " 'is_incremental_load': False\n", " }\n", @@ -292,16 +292,16 @@ " 'auth': 'user',\n", " 'report': {\n", " 'timeout': 90,\n", - " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 1,'default': '','description': 'Campaign Manager Account Id.'}},\n", + " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 2,'default': '','description': 'Campaign Manager Account Id.'}},\n", " 'filters': {\n", " 'dfa:advertiser': {\n", - " 'values': {'field': {'name': 'cm_advertiser_ids','kind': 'integer_list','order': 3,'default': '','description': 'Optional: Comma delimited list of DCM advertiser ids.'}}\n", + " 'values': {'field': {'name': 'cm_advertiser_ids','kind': 'integer_list','order': 3,'default': '','description': 'Optional: Comma delimited list of CM advertiser ids.'}}\n", " }\n", " },\n", " 'body': {\n", " 'kind': 'dfareporting#report',\n", - " 'name': {'field': {'name': 'recipe_name','kind': 'string','order': 9,'prefix': 'ITP_Audit_Browser_','default': 'ITP_Audit_Dashboard_Browser','description': 'Name of the Campaign Manager browser report.'}},\n", - " 'fileName': {'field': {'name': 'recipe_name','kind': 'string','order': 9,'prefix': 'ITP_Audit_Browser_','default': 'ITP_Audit_Dashboard_Browser','description': 'Name of the Campaign Manager browser report.'}},\n", + " 'name': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'prefix': 'ITP_Audit_Browser_','default': 'ITP_Audit_Dashboard_Browser','description': 'Name of the Campaign Manager browser report.'}},\n", + " 'fileName': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'prefix': 'ITP_Audit_Browser_','default': 'ITP_Audit_Dashboard_Browser','description': 'Name of the Campaign Manager browser report.'}},\n", " 'format': 'CSV',\n", " 'type': 'STANDARD',\n", " 'criteria': {\n", @@ -372,7 +372,7 @@ " },\n", " 'out': {\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_CM_Browser_Report_Dirty',\n", " 'is_incremental_load': False\n", " }\n", @@ -383,14 +383,14 @@ " {\n", " 'sheets': {\n", " 'auth': 'user',\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'tab': 'Enviroment',\n", " 'range': 'A:B',\n", " 'header': True,\n", " 'out': {\n", " 'auth': 'user',\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Environment'\n", " }\n", " }\n", @@ -399,14 +399,14 @@ " {\n", " 'sheets': {\n", " 'auth': 'user',\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'tab': 'Browser',\n", " 'range': 'A:C',\n", " 'header': True,\n", " 'out': {\n", " 'auth': 'user',\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Browser'\n", " }\n", " }\n", @@ -415,14 +415,14 @@ " {\n", " 'sheets': {\n", " 'auth': 'user',\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'tab': 'CM_Browser_lookup',\n", " 'range': 'A:C',\n", " 'header': True,\n", " 'out': {\n", " 'auth': 'user',\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_CM_Browser_lookup'\n", " }\n", " }\n", @@ -431,14 +431,14 @@ " {\n", " 'sheets': {\n", " 'auth': 'user',\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'tab': 'Device_Type',\n", " 'range': 'A:B',\n", " 'header': True,\n", " 'out': {\n", " 'auth': 'user',\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Device_Type'\n", " }\n", " }\n", @@ -447,14 +447,14 @@ " {\n", " 'sheets': {\n", " 'auth': 'user',\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'tab': 'Floodlight_Attribution',\n", " 'range': 'A:B',\n", " 'header': True,\n", " 'out': {\n", " 'auth': 'user',\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Floodlight_Attribution'\n", " }\n", " }\n", @@ -464,11 +464,11 @@ " 'dbm': {\n", " 'auth': 'user',\n", " 'report': {\n", - " 'name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Browser_','order': 7,'description': 'Name of report in DBM, should be unique.'}}\n", + " 'name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'ITP_Audit_Browser_','order': 1,'description': 'Name of report in DV360, should be unique.'}}\n", " },\n", " 'out': {\n", " 'bigquery': {\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", " 'table': 'z_Dv360_Browser_Report_Dirty'\n", " }\n", " }\n", @@ -477,9 +477,9 @@ " {\n", " 'itp_audit': {\n", " 'auth': 'user',\n", - " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 1,'default': '','description': 'Campaign Manager Account Id.'}},\n", - " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 7,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", - " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 7,'description': 'Name of document to deploy to.','default': ''}},\n", + " 'account': {'field': {'name': 'cm_account_id','kind': 'string','order': 2,'default': '','description': 'Campaign Manager Account Id.'}},\n", + " 'dataset': {'field': {'name': 'recipe_name','kind': 'string','order': 1,'default': 'ITP_Audit_Dashboard','description': 'BigQuery dataset for store dashboard tables.'}},\n", + " 'sheet': {'field': {'name': 'recipe_name','prefix': 'ITP Audit ','kind': 'string','order': 1,'description': 'Name of document to deploy to.','default': ''}},\n", " 'timeout': 60\n", " }\n", " }\n", diff --git a/colabs/monthly_budget_mover.ipynb b/colabs/monthly_budget_mover.ipynb index 674c3974..c8e63b96 100644 --- a/colabs/monthly_budget_mover.ipynb +++ b/colabs/monthly_budget_mover.ipynb @@ -105,12 +105,14 @@ }, "source": [ "FIELDS = {\n", + " 'recipe_timezone': 'America/Los_Angeles', # Timezone for report dates.\n", " 'recipe_name': '', # \n", - " 'spend_report_id': '', # The report Id for the DV360 spend report.\n", - " 'budget_categories': '{\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}', # A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format.\n", + " 'partner_id': '', # The sdf file types.\n", + " 'budget_categories': '{}', # A dictionary to show which IO Ids go under which Category. {\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}\n", + " 'filter_ids': [], # Comma separated list of filter ids for the request.\n", " 'excluded_ios': '', # A comma separated list of Inserion Order Ids that should be exluded from the budget calculations\n", - " 'filter_type': '', # The filter type for the filter ids.\n", - " 'filter_ids': '', # The filter ids for the request.\n", + " 'version': '5', # The sdf version to be returned.\n", + " 'is_colab': True, # Are you running this in Colab? (This will store the files in Colab instead of Bigquery)\n", " 'dataset': '', # Dataset that you would like your output tables to be produced in.\n", "}\n", "\n", @@ -147,22 +149,93 @@ " }\n", " },\n", " {\n", + " 'dbm': {\n", + " 'auth': 'user',\n", + " 'report': {\n", + " 'timeout': 90,\n", + " 'filters': {\n", + " 'FILTER_ADVERTISER': {\n", + " 'values': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 7,'default': '','description': 'The comma separated list of Advertiser Ids.'}}\n", + " }\n", + " },\n", + " 'body': {\n", + " 'timezoneCode': {'field': {'name': 'recipe_timezone','kind': 'timezone','description': 'Timezone for report dates.','default': 'America/Los_Angeles'}},\n", + " 'metadata': {\n", + " 'title': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'Monthly_Budget_Mover_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n", + " 'dataRange': 'PREVIOUS_MONTH',\n", + " 'format': 'CSV'\n", + " },\n", + " 'params': {\n", + " 'type': 'TYPE_GENERAL',\n", + " 'groupBys': [\n", + " 'FILTER_ADVERTISER_CURRENCY',\n", + " 'FILTER_INSERTION_ORDER'\n", + " ],\n", + " 'metrics': [\n", + " 'METRIC_REVENUE_ADVERTISER'\n", + " ]\n", + " }\n", + " }\n", + " },\n", + " 'delete': False\n", + " }\n", + " },\n", + " {\n", " 'monthly_budget_mover': {\n", " 'auth': 'user',\n", - " 'spend_report_id': {'field': {'name': 'spend_report_id','kind': 'string','order': 2,'default': '','description': 'The report Id for the DV360 spend report.'}},\n", - " 'budget_categories': {'field': {'name': 'budget_categories','kind': 'json','order': 3,'default': '{\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}','description': 'A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format.'}},\n", + " 'is_colab': {'field': {'name': 'is_colab','kind': 'boolean','default': True,'order': 7,'description': 'Are you running this in Colab? (This will store the files in Colab instead of Bigquery)'}},\n", + " 'report_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'Monthly_Budget_Mover_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n", + " 'budget_categories': {'field': {'name': 'budget_categories','kind': 'json','order': 3,'default': '{}','description': 'A dictionary to show which IO Ids go under which Category. {\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}'}},\n", " 'excluded_ios': {'field': {'name': 'excluded_ios','kind': 'integer_list','order': 4,'description': 'A comma separated list of Inserion Order Ids that should be exluded from the budget calculations'}},\n", " 'sdf': {\n", " 'auth': 'user',\n", + " 'version': {'field': {'name': 'version','kind': 'choice','order': 6,'default': '5','description': 'The sdf version to be returned.','choices': ['SDF_VERSION_5','SDF_VERSION_5_1']}},\n", + " 'partner_id': {'field': {'name': 'partner_id','kind': 'integer','order': 1,'description': 'The sdf file types.'}},\n", " 'file_types': 'INSERTION_ORDER',\n", - " 'filter_type': {'field': {'name': 'filter_type','kind': 'choice','order': 6,'default': '','description': 'The filter type for the filter ids.','choices': ['ADVERTISER_ID','CAMPAIGN_ID','INSERTION_ORDER_ID','INVENTORY_SOURCE_ID','LINE_ITEM_ID','PARTNER_ID']}},\n", - " 'filter_ids': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 7,'default': '','description': 'The filter ids for the request.'}}\n", + " 'filter_type': 'FILTER_TYPE_ADVERTISER_ID',\n", + " 'read': {\n", + " 'filter_ids': {\n", + " 'single_cell': True,\n", + " 'values': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 4,'default': [],'description': 'Comma separated list of filter ids for the request.'}}\n", + " }\n", + " },\n", + " 'time_partitioned_table': False,\n", + " 'create_single_day_table': False,\n", + " 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 6,'default': '','description': 'Dataset to be written to in BigQuery.'}},\n", + " 'table_suffix': ''\n", + " },\n", + " 'out_old_sdf': {\n", + " 'bigquery': {\n", + " 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n", + " 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_OLD_','description': ''}},\n", + " 'schema': [\n", + " ],\n", + " 'skip_rows': 0,\n", + " 'disposition': 'WRITE_TRUNCATE'\n", + " },\n", + " 'file': '/content/old_sdf.csv'\n", + " },\n", + " 'out_new_sdf': {\n", + " 'bigquery': {\n", + " 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n", + " 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_NEW_','description': ''}},\n", + " 'schema': [\n", + " ],\n", + " 'skip_rows': 0,\n", + " 'disposition': 'WRITE_TRUNCATE'\n", + " },\n", + " 'file': '/content/new_sdf.csv'\n", " },\n", - " 'out': {\n", - " 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n", - " 'old_sdf_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_OLD_','description': ''}},\n", - " 'new_sdf_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_NEW_','description': ''}},\n", - " 'changes_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_BUDGET_MOVER_LOG_','description': ''}}\n", + " 'out_changes': {\n", + " 'bigquery': {\n", + " 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n", + " 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_BUDGET_MOVER_LOG_','description': ''}},\n", + " 'schema': [\n", + " ],\n", + " 'skip_rows': 0,\n", + " 'disposition': 'WRITE_TRUNCATE'\n", + " },\n", + " 'file': '/content/log.csv'\n", " }\n", " }\n", " }\n", diff --git a/dags/monthly_budget_mover_dag.py b/dags/monthly_budget_mover_dag.py index 9381c710..e915f7eb 100644 --- a/dags/monthly_budget_mover_dag.py +++ b/dags/monthly_budget_mover_dag.py @@ -57,12 +57,14 @@ GCP_CONN_ID = "starthinker_service" # The connection to use for service authentication. INPUTS = { + 'recipe_timezone': 'America/Los_Angeles', # Timezone for report dates. 'recipe_name': '', # - 'spend_report_id': '', # The report Id for the DV360 spend report. - 'budget_categories': '{"CATEGORY1":[12345,12345,12345], "CATEGORY2":[12345,12345]}', # A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format. + 'partner_id': '', # The sdf file types. + 'budget_categories': '{}', # A dictionary to show which IO Ids go under which Category. {"CATEGORY1":[12345,12345,12345], "CATEGORY2":[12345,12345]} + 'filter_ids': [], # Comma separated list of filter ids for the request. 'excluded_ios': '', # A comma separated list of Inserion Order Ids that should be exluded from the budget calculations - 'filter_type': '', # The filter type for the filter ids. - 'filter_ids': '', # The filter ids for the request. + 'version': '5', # The sdf version to be returned. + 'is_colab': True, # Are you running this in Colab? (This will store the files in Colab instead of Bigquery) 'dataset': '', # Dataset that you would like your output tables to be produced in. } @@ -81,16 +83,80 @@ } } }, + { + 'dbm': { + 'auth': 'user', + 'report': { + 'timeout': 90, + 'filters': { + 'FILTER_ADVERTISER': { + 'values': { + 'field': { + 'name': 'filter_ids', + 'kind': 'integer_list', + 'order': 7, + 'default': '', + 'description': 'The comma separated list of Advertiser Ids.' + } + } + } + }, + 'body': { + 'timezoneCode': { + 'field': { + 'name': 'recipe_timezone', + 'kind': 'timezone', + 'description': 'Timezone for report dates.', + 'default': 'America/Los_Angeles' + } + }, + 'metadata': { + 'title': { + 'field': { + 'name': 'recipe_name', + 'kind': 'string', + 'prefix': 'Monthly_Budget_Mover_', + 'order': 1, + 'description': 'Name of report in DV360, should be unique.' + } + }, + 'dataRange': 'PREVIOUS_MONTH', + 'format': 'CSV' + }, + 'params': { + 'type': 'TYPE_GENERAL', + 'groupBys': [ + 'FILTER_ADVERTISER_CURRENCY', + 'FILTER_INSERTION_ORDER' + ], + 'metrics': [ + 'METRIC_REVENUE_ADVERTISER' + ] + } + } + }, + 'delete': False + } + }, { 'monthly_budget_mover': { 'auth': 'user', - 'spend_report_id': { + 'is_colab': { 'field': { - 'name': 'spend_report_id', + 'name': 'is_colab', + 'kind': 'boolean', + 'default': True, + 'order': 7, + 'description': 'Are you running this in Colab? (This will store the files in Colab instead of Bigquery)' + } + }, + 'report_name': { + 'field': { + 'name': 'recipe_name', 'kind': 'string', - 'order': 2, - 'default': '', - 'description': 'The report Id for the DV360 spend report.' + 'prefix': 'Monthly_Budget_Mover_', + 'order': 1, + 'description': 'Name of report in DV360, should be unique.' } }, 'budget_categories': { @@ -98,8 +164,8 @@ 'name': 'budget_categories', 'kind': 'json', 'order': 3, - 'default': '{"CATEGORY1":[12345,12345,12345], "CATEGORY2":[12345,12345]}', - 'description': 'A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format.' + 'default': '{}', + 'description': 'A dictionary to show which IO Ids go under which Category. {"CATEGORY1":[12345,12345,12345], "CATEGORY2":[12345,12345]}' } }, 'excluded_ios': { @@ -112,68 +178,134 @@ }, 'sdf': { 'auth': 'user', - 'file_types': 'INSERTION_ORDER', - 'filter_type': { + 'version': { 'field': { - 'name': 'filter_type', + 'name': 'version', 'kind': 'choice', 'order': 6, - 'default': '', - 'description': 'The filter type for the filter ids.', + 'default': '5', + 'description': 'The sdf version to be returned.', 'choices': [ - 'ADVERTISER_ID', - 'CAMPAIGN_ID', - 'INSERTION_ORDER_ID', - 'INVENTORY_SOURCE_ID', - 'LINE_ITEM_ID', - 'PARTNER_ID' + 'SDF_VERSION_5', + 'SDF_VERSION_5_1' ] } }, - 'filter_ids': { + 'partner_id': { 'field': { - 'name': 'filter_ids', - 'kind': 'integer_list', - 'order': 7, - 'default': '', - 'description': 'The filter ids for the request.' + 'name': 'partner_id', + 'kind': 'integer', + 'order': 1, + 'description': 'The sdf file types.' } - } - }, - 'out': { + }, + 'file_types': 'INSERTION_ORDER', + 'filter_type': 'FILTER_TYPE_ADVERTISER_ID', + 'read': { + 'filter_ids': { + 'single_cell': True, + 'values': { + 'field': { + 'name': 'filter_ids', + 'kind': 'integer_list', + 'order': 4, + 'default': [ + ], + 'description': 'Comma separated list of filter ids for the request.' + } + } + } + }, + 'time_partitioned_table': False, + 'create_single_day_table': False, 'dataset': { 'field': { 'name': 'dataset', 'kind': 'string', - 'order': 8, + 'order': 6, 'default': '', - 'description': 'Dataset that you would like your output tables to be produced in.' + 'description': 'Dataset to be written to in BigQuery.' } }, - 'old_sdf_table_name': { - 'field': { - 'name': 'recipe_name', - 'kind': 'string', - 'prefix': 'SDF_OLD_', - 'description': '' - } + 'table_suffix': '' + }, + 'out_old_sdf': { + 'bigquery': { + 'dataset': { + 'field': { + 'name': 'dataset', + 'kind': 'string', + 'order': 8, + 'default': '', + 'description': 'Dataset that you would like your output tables to be produced in.' + } + }, + 'table': { + 'field': { + 'name': 'recipe_name', + 'kind': 'string', + 'prefix': 'SDF_OLD_', + 'description': '' + } + }, + 'schema': [ + ], + 'skip_rows': 0, + 'disposition': 'WRITE_TRUNCATE' }, - 'new_sdf_table_name': { - 'field': { - 'name': 'recipe_name', - 'kind': 'string', - 'prefix': 'SDF_NEW_', - 'description': '' - } + 'file': '/content/old_sdf.csv' + }, + 'out_new_sdf': { + 'bigquery': { + 'dataset': { + 'field': { + 'name': 'dataset', + 'kind': 'string', + 'order': 8, + 'default': '', + 'description': 'Dataset that you would like your output tables to be produced in.' + } + }, + 'table': { + 'field': { + 'name': 'recipe_name', + 'kind': 'string', + 'prefix': 'SDF_NEW_', + 'description': '' + } + }, + 'schema': [ + ], + 'skip_rows': 0, + 'disposition': 'WRITE_TRUNCATE' }, - 'changes_table_name': { - 'field': { - 'name': 'recipe_name', - 'kind': 'string', - 'prefix': 'SDF_BUDGET_MOVER_LOG_', - 'description': '' - } - } + 'file': '/content/new_sdf.csv' + }, + 'out_changes': { + 'bigquery': { + 'dataset': { + 'field': { + 'name': 'dataset', + 'kind': 'string', + 'order': 8, + 'default': '', + 'description': 'Dataset that you would like your output tables to be produced in.' + } + }, + 'table': { + 'field': { + 'name': 'recipe_name', + 'kind': 'string', + 'prefix': 'SDF_BUDGET_MOVER_LOG_', + 'description': '' + } + }, + 'schema': [ + ], + 'skip_rows': 0, + 'disposition': 'WRITE_TRUNCATE' + }, + 'file': '/content/log.csv' } } } diff --git a/docs/index.html b/docs/index.html index 7b227c84..44f0145d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -306,45 +306,6 @@

-
-
-
- - - more_vert - - - language

- Browser Activity Dashboard ( 2019 ) -
-
-

Visualizes a client's Campaign Manager and DV360 activity by browser and device

-
-
- close -
- - - - - - - - - - - - - - - - -
Understand client exposure to ITP and ETP.
Identify browser impact across devices.
Monitor impact over time.
-
-
-
-
-
@@ -413,7 +374,7 @@

-
+
@@ -692,7 +653,7 @@

-
+
@@ -1319,6 +1280,37 @@

+
+
+
+ + + more_vert + + + donut_small

+ ITP Audit Dashboard ( 2020 ) +
+
+

Dashboard that shows performance metrics across browser to see the impact of ITP.

+
+
+ close +
+ + + + + + + + +
See drilled down metrics of your accounts performance as ITP changes
+
+
+
+
+
diff --git a/docs/solution/audience_analysis/index.html b/docs/solution/audience_analysis/index.html index 3d401e81..31943ffa 100644 --- a/docs/solution/audience_analysis/index.html +++ b/docs/solution/audience_analysis/index.html @@ -292,7 +292,7 @@

people  DV360 Audience Analysis Age - Feb. 18, 2020 (3 months, 4 weeks) + Feb. 18, 2020 (4 months) diff --git a/docs/solution/bigquery_to_sheet/index.html b/docs/solution/bigquery_to_sheet/index.html index 430bb118..57ee56f0 100644 --- a/docs/solution/bigquery_to_sheet/index.html +++ b/docs/solution/bigquery_to_sheet/index.html @@ -194,7 +194,7 @@

arrow_forward  Query to Sheet

Age - Aug. 7, 2019 (10 months, 1 week) + Aug. 7, 2019 (10 months, 2 weeks) diff --git a/docs/solution/cm_campaign_audit/index.html b/docs/solution/cm_campaign_audit/index.html index 35e23684..36215be2 100644 --- a/docs/solution/cm_campaign_audit/index.html +++ b/docs/solution/cm_campaign_audit/index.html @@ -296,7 +296,7 @@

done_outline  CM Campaign Auditor< Age - March 23, 2020 (2 months, 3 weeks) + March 23, 2020 (3 months) diff --git a/docs/solution/cm_user_editor/index.html b/docs/solution/cm_user_editor/index.html index 63548cef..be23cce3 100644 --- a/docs/solution/cm_user_editor/index.html +++ b/docs/solution/cm_user_editor/index.html @@ -306,7 +306,7 @@

security  CM User Editor

Age - March 23, 2020 (2 months, 3 weeks) + March 23, 2020 (3 months) diff --git a/docs/solution/ctv_audience_affinity/index.html b/docs/solution/ctv_audience_affinity/index.html index dbcbd785..15a2e16e 100644 --- a/docs/solution/ctv_audience_affinity/index.html +++ b/docs/solution/ctv_audience_affinity/index.html @@ -246,7 +246,7 @@

donut_large  cTV Inventory Availab Age - April 8, 2020 (2 months, 1 week) + April 8, 2020 (2 months, 2 weeks) diff --git a/docs/solution/dbm_to_bigquery/index.html b/docs/solution/dbm_to_bigquery/index.html index f5e3f946..168d490b 100644 --- a/docs/solution/dbm_to_bigquery/index.html +++ b/docs/solution/dbm_to_bigquery/index.html @@ -264,6 +264,7 @@

donut_large  DV360 To BigQuery

donut_large  DV360 To Storage

}, "out": { "storage": { + "auth": "service", "bucket": { "field": { "name": "dbm_bucket", diff --git a/docs/solution/dcm_api_to_bigquery/index.html b/docs/solution/dcm_api_to_bigquery/index.html index bb108444..123dffd5 100644 --- a/docs/solution/dcm_api_to_bigquery/index.html +++ b/docs/solution/dcm_api_to_bigquery/index.html @@ -194,7 +194,7 @@

donut_small  CM API To BigQuery Age - Feb. 20, 2019 (1 year, 3 months) + Feb. 20, 2019 (1 year, 4 months) diff --git a/docs/solution/dcm_replicate_to_bigquery/index.html b/docs/solution/dcm_replicate_to_bigquery/index.html index b53b5318..6acd4a8a 100644 --- a/docs/solution/dcm_replicate_to_bigquery/index.html +++ b/docs/solution/dcm_replicate_to_bigquery/index.html @@ -196,7 +196,7 @@

donut_small  CM Report Replicate Age - March 3, 2020 (3 months, 2 weeks) + March 3, 2020 (3 months, 3 weeks) diff --git a/docs/solution/dcm_to_bigquery/index.html b/docs/solution/dcm_to_bigquery/index.html index 347e4776..44210083 100644 --- a/docs/solution/dcm_to_bigquery/index.html +++ b/docs/solution/dcm_to_bigquery/index.html @@ -277,6 +277,7 @@

donut_small  CM To BigQuery

}, "out": { "bigquery": { + "auth": "service", "dataset": { "field": { "name": "dataset", diff --git a/docs/solution/dcm_to_storage/index.html b/docs/solution/dcm_to_storage/index.html index e1e2b03f..19f259e9 100644 --- a/docs/solution/dcm_to_storage/index.html +++ b/docs/solution/dcm_to_storage/index.html @@ -274,6 +274,7 @@

donut_small  CM To Storage

}, "out": { "storage": { + "auth": "service", "bucket": { "field": { "name": "bucket", diff --git a/docs/solution/deal_finder/index.html b/docs/solution/deal_finder/index.html index 354abbf5..22843930 100644 --- a/docs/solution/deal_finder/index.html +++ b/docs/solution/deal_finder/index.html @@ -300,7 +300,7 @@

whatshot  Deal Finder

Age - Nov. 22, 2017 (2 years, 6 months) + Nov. 22, 2017 (2 years, 7 months) diff --git a/docs/solution/drive_copy/index.html b/docs/solution/drive_copy/index.html index 6e239eef..51f2b206 100644 --- a/docs/solution/drive_copy/index.html +++ b/docs/solution/drive_copy/index.html @@ -192,7 +192,7 @@

file_copy  Drive Copy

Age - Aug. 28, 2019 (9 months, 3 weeks) + Aug. 28, 2019 (9 months, 4 weeks) diff --git a/docs/solution/dv360_feature_adoption/index.html b/docs/solution/dv360_feature_adoption/index.html index 736aa20a..a2ca8d8f 100644 --- a/docs/solution/dv360_feature_adoption/index.html +++ b/docs/solution/dv360_feature_adoption/index.html @@ -302,7 +302,7 @@

cloud_queue  DV360 Feature Adoptio Age - Feb. 6, 2020 (4 months, 1 week) + Feb. 6, 2020 (4 months, 2 weeks) diff --git a/docs/solution/dv3po_custom_signals/index.html b/docs/solution/dv3po_custom_signals/index.html index 31c4e1da..c98106dc 100644 --- a/docs/solution/dv3po_custom_signals/index.html +++ b/docs/solution/dv3po_custom_signals/index.html @@ -288,7 +288,7 @@

donut_small  [DV-3PO] Custom Signa Age - April 22, 2020 (1 month, 3 weeks) + April 22, 2020 (2 months) diff --git a/docs/solution/dynamic_costs/index.html b/docs/solution/dynamic_costs/index.html index 2943b563..bd4ebce3 100644 --- a/docs/solution/dynamic_costs/index.html +++ b/docs/solution/dynamic_costs/index.html @@ -201,7 +201,7 @@

monetization_on  Dynamic Costs Rep Authors - kenjora@google.com
aritrab@google.com
+ aritrab@google.com
kenjora@google.com
diff --git a/docs/solution/email_cm_to_bigquery/index.html b/docs/solution/email_cm_to_bigquery/index.html index b242eb3b..ddcc11e4 100644 --- a/docs/solution/email_cm_to_bigquery/index.html +++ b/docs/solution/email_cm_to_bigquery/index.html @@ -298,7 +298,7 @@

email  CM Report Emailed To BigQue Age - March 11, 2020 (3 months) + March 11, 2020 (3 months, 1 week) diff --git a/docs/solution/email_dv360_to_bigquery/index.html b/docs/solution/email_dv360_to_bigquery/index.html index 1f423950..7d53399a 100644 --- a/docs/solution/email_dv360_to_bigquery/index.html +++ b/docs/solution/email_dv360_to_bigquery/index.html @@ -298,7 +298,7 @@

email  DV360 Report Emailed To Big Age - March 11, 2020 (3 months) + March 11, 2020 (3 months, 1 week) diff --git a/docs/solution/ga_timeline/index.html b/docs/solution/ga_timeline/index.html index 6ce56b16..3b3bc449 100644 --- a/docs/solution/ga_timeline/index.html +++ b/docs/solution/ga_timeline/index.html @@ -278,7 +278,7 @@

timeline  Google Analytics Timelin Age - July 25, 2019 (10 months, 3 weeks) + July 25, 2019 (11 months) diff --git a/docs/solution/index.html b/docs/solution/index.html index 7b227c84..44f0145d 100644 --- a/docs/solution/index.html +++ b/docs/solution/index.html @@ -306,45 +306,6 @@

-
-
-
- - - more_vert - - - language

- Browser Activity Dashboard ( 2019 ) -
-
-

Visualizes a client's Campaign Manager and DV360 activity by browser and device

-
-
- close -
- - - - - - - - - - - - - - - - -
Understand client exposure to ITP and ETP.
Identify browser impact across devices.
Monitor impact over time.
-
-
-
-
-
@@ -413,7 +374,7 @@

-
+
@@ -692,7 +653,7 @@

-
+
@@ -1319,6 +1280,37 @@

+
+
+
+ + + more_vert + + + donut_small

+ ITP Audit Dashboard ( 2020 ) +
+
+

Dashboard that shows performance metrics across browser to see the impact of ITP.

+
+
+ close +
+ + + + + + + + +
See drilled down metrics of your accounts performance as ITP changes
+
+
+
+
+
diff --git a/docs/solution/itp_audit/index.html b/docs/solution/itp_audit/index.html new file mode 100644 index 00000000..da050385 --- /dev/null +++ b/docs/solution/itp_audit/index.html @@ -0,0 +1,977 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+

donut_small  ITP Audit Dashboard ( 2020 )

+

Dashboard that shows performance metrics across browser to see the impact of ITP.

+ + All + + cm + + dv360 + + datastudio + + bigquery + + +

+ + solution + + audience + + + + + + +

+ +
+ +
+
+ + + + + + + + + + + + + +
Value Proposition
See drilled down metrics of your accounts performance as ITP changes
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ImpactLevel
Spend Optimization +
+
+
+
Spend Growth +
+
+
+
Time Savings +
+
+
+
Account Health +
+
+
+
Csat Improvement +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Details
This solution has anonymized data and is OK to share with clients.
AgeNov. 19, 2019 (7 months)
Authorsterwilleger@google.com
aallamang@google.com
+
+
+
+ + +
+
+ + + + + + + + + + + + + +
Instructions
Follow the instructions from this document
+
+
+ + +
+
Workflowexpand_more[
+    {
+        "drive": {
+            "auth": "user",
+            "hour": [],
+            "copy": {
+                "source": "https://docs.google.com/spreadsheets/d/1rH_PGXOYW2mVdmAYnKbv6kcaB6lQihAyMsGtFfinnqg/",
+                "destination": {
+                    "field": {
+                        "name": "recipe_name",
+                        "prefix": "ITP Audit ",
+                        "kind": "string",
+                        "order": 1,
+                        "description": "Name of document to deploy to.",
+                        "default": ""
+                    }
+                }
+            }
+        }
+    },
+    {
+        "dataset": {
+            "auth": "service",
+            "dataset": {
+                "field": {
+                    "name": "recipe_name",
+                    "kind": "string",
+                    "order": 1,
+                    "default": "ITP_Audit_Dashboard",
+                    "description": "BigQuery dataset for store dashboard tables."
+                }
+            }
+        }
+    },
+    {
+        "dbm": {
+            "auth": "user",
+            "report": {
+                "timeout": 90,
+                "filters": {
+                    "FILTER_ADVERTISER": {
+                        "values": {
+                            "field": {
+                                "name": "dv360_advertiser_ids",
+                                "kind": "integer_list",
+                                "order": 6,
+                                "default": "",
+                                "description": "Optional: Comma delimited list of DV360 Advertiser ids."
+                            }
+                        }
+                    },
+                    "FILTER_PARTNER": {
+                        "values": {
+                            "field": {
+                                "name": "dv360_partner_ids",
+                                "kind": "integer_list",
+                                "order": 5,
+                                "default": "",
+                                "description": "Comma delimited list of DV360 Partner ids."
+                            }
+                        }
+                    }
+                },
+                "body": {
+                    "timezoneCode": {
+                        "field": {
+                            "name": "recipe_timezone",
+                            "kind": "timezone",
+                            "description": "Timezone for report dates.",
+                            "default": "America/Los_Angeles"
+                        }
+                    },
+                    "metadata": {
+                        "title": {
+                            "field": {
+                                "name": "recipe_name",
+                                "kind": "string",
+                                "prefix": "ITP_Audit_Browser_",
+                                "order": 1,
+                                "description": "Name of report in DV360, should be unique."
+                            }
+                        },
+                        "dataRange": "LAST_365_DAYS",
+                        "format": "CSV"
+                    },
+                    "params": {
+                        "type": "TYPE_GENERAL",
+                        "groupBys": [
+                            "FILTER_ADVERTISER",
+                            "FILTER_ADVERTISER_CURRENCY",
+                            "FILTER_MEDIA_PLAN",
+                            "FILTER_INSERTION_ORDER",
+                            "FILTER_LINE_ITEM",
+                            "FILTER_PAGE_LAYOUT",
+                            "FILTER_WEEK",
+                            "FILTER_MONTH",
+                            "FILTER_YEAR",
+                            "FILTER_PARTNER",
+                            "FILTER_LINE_ITEM_TYPE",
+                            "FILTER_DEVICE_TYPE",
+                            "FILTER_BROWSER"
+                        ],
+                        "metrics": [
+                            "METRIC_MEDIA_COST_ADVERTISER",
+                            "METRIC_IMPRESSIONS",
+                            "METRIC_CLICKS",
+                            "METRIC_TOTAL_CONVERSIONS",
+                            "METRIC_LAST_CLICKS",
+                            "METRIC_LAST_IMPRESSIONS",
+                            "METRIC_CM_POST_CLICK_REVENUE",
+                            "METRIC_CM_POST_VIEW_REVENUE",
+                            "METRIC_REVENUE_ADVERTISER"
+                        ]
+                    }
+                }
+            },
+            "delete": false
+        }
+    },
+    {
+        "dcm": {
+            "auth": "user",
+            "report": {
+                "timeout": 90,
+                "account": {
+                    "field": {
+                        "name": "cm_account_id",
+                        "kind": "string",
+                        "order": 2,
+                        "default": "",
+                        "description": "Campaign Manager Account Id."
+                    }
+                },
+                "body": {
+                    "kind": "dfareporting#report",
+                    "name": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "prefix": "ITP_Audit_Floodlight_",
+                            "order": 1,
+                            "description": "Name of report in DV360, should be unique."
+                        }
+                    },
+                    "format": "CSV",
+                    "type": "FLOODLIGHT",
+                    "floodlightCriteria": {
+                        "dateRange": {
+                            "kind": "dfareporting#dateRange",
+                            "relativeDateRange": "LAST_30_DAYS"
+                        },
+                        "floodlightConfigId": {
+                            "kind": "dfareporting#dimensionValue",
+                            "dimensionName": "dfa:floodlightConfigId",
+                            "value": {
+                                "field": {
+                                    "name": "floodlight_configuration_id",
+                                    "kind": "integer",
+                                    "order": 4,
+                                    "default": "",
+                                    "description": "Floodlight Configuration Id for the Campaign Manager floodlight report."
+                                }
+                            },
+                            "matchType": "EXACT"
+                        },
+                        "reportProperties": {
+                            "includeUnattributedIPConversions": false,
+                            "includeUnattributedCookieConversions": true
+                        },
+                        "dimensions": [
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:site"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:floodlightAttributionType"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:interactionType"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:pathType"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:browserPlatform"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:platformType"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:week"
+                            }
+                        ],
+                        "metricNames": [
+                            "dfa:activityClickThroughConversions",
+                            "dfa:activityViewThroughConversions",
+                            "dfa:totalConversions",
+                            "dfa:totalConversionsRevenue"
+                        ]
+                    },
+                    "schedule": {
+                        "active": true,
+                        "repeats": "WEEKLY",
+                        "every": 1,
+                        "repeatsOnWeekDays": [
+                            "Sunday"
+                        ]
+                    },
+                    "delivery": {
+                        "emailOwner": false
+                    }
+                }
+            },
+            "out": {
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Floodlight_CM_Report",
+                    "is_incremental_load": false
+                }
+            },
+            "delete": false
+        }
+    },
+    {
+        "dcm": {
+            "auth": "user",
+            "report": {
+                "timeout": 90,
+                "account": {
+                    "field": {
+                        "name": "cm_account_id",
+                        "kind": "string",
+                        "order": 2,
+                        "default": "",
+                        "description": "Campaign Manager Account Id."
+                    }
+                },
+                "filters": {
+                    "dfa:advertiser": {
+                        "values": {
+                            "field": {
+                                "name": "cm_advertiser_ids",
+                                "kind": "integer_list",
+                                "order": 3,
+                                "default": "",
+                                "description": "Optional: Comma delimited list of CM advertiser ids."
+                            }
+                        }
+                    }
+                },
+                "body": {
+                    "kind": "dfareporting#report",
+                    "name": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "prefix": "ITP_Audit_Browser_",
+                            "default": "ITP_Audit_Dashboard_Browser",
+                            "description": "Name of the Campaign Manager browser report."
+                        }
+                    },
+                    "fileName": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "prefix": "ITP_Audit_Browser_",
+                            "default": "ITP_Audit_Dashboard_Browser",
+                            "description": "Name of the Campaign Manager browser report."
+                        }
+                    },
+                    "format": "CSV",
+                    "type": "STANDARD",
+                    "criteria": {
+                        "dateRange": {
+                            "kind": "dfareporting#dateRange",
+                            "relativeDateRange": "LAST_365_DAYS"
+                        },
+                        "dimensions": [
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:campaign"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:campaignId"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:site"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:advertiser"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:advertiserId"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:browserPlatform"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:platformType"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:month"
+                            },
+                            {
+                                "kind": "dfareporting#sortedDimension",
+                                "name": "dfa:week"
+                            }
+                        ],
+                        "metricNames": [
+                            "dfa:impressions",
+                            "dfa:clicks",
+                            "dfa:totalConversions",
+                            "dfa:activityViewThroughConversions",
+                            "dfa:activityClickThroughConversions"
+                        ],
+                        "dimensionFilters": []
+                    },
+                    "schedule": {
+                        "active": true,
+                        "repeats": "WEEKLY",
+                        "every": 1,
+                        "repeatsOnWeekDays": [
+                            "Sunday"
+                        ]
+                    },
+                    "delivery": {
+                        "emailOwner": false
+                    }
+                }
+            },
+            "out": {
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_CM_Browser_Report_Dirty",
+                    "is_incremental_load": false
+                }
+            },
+            "delete": false
+        }
+    },
+    {
+        "sheets": {
+            "auth": "user",
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "tab": "Enviroment",
+            "range": "A:B",
+            "header": true,
+            "out": {
+                "auth": "service",
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Environment"
+                }
+            }
+        }
+    },
+    {
+        "sheets": {
+            "auth": "user",
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "tab": "Browser",
+            "range": "A:C",
+            "header": true,
+            "out": {
+                "auth": "service",
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Browser"
+                }
+            }
+        }
+    },
+    {
+        "sheets": {
+            "auth": "user",
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "tab": "CM_Browser_lookup",
+            "range": "A:C",
+            "header": true,
+            "out": {
+                "auth": "service",
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_CM_Browser_lookup"
+                }
+            }
+        }
+    },
+    {
+        "sheets": {
+            "auth": "user",
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "tab": "Device_Type",
+            "range": "A:B",
+            "header": true,
+            "out": {
+                "auth": "service",
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Device_Type"
+                }
+            }
+        }
+    },
+    {
+        "sheets": {
+            "auth": "user",
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "tab": "Floodlight_Attribution",
+            "range": "A:B",
+            "header": true,
+            "out": {
+                "auth": "service",
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Floodlight_Attribution"
+                }
+            }
+        }
+    },
+    {
+        "dbm": {
+            "auth": "user",
+            "report": {
+                "name": {
+                    "field": {
+                        "name": "recipe_name",
+                        "kind": "string",
+                        "prefix": "ITP_Audit_Browser_",
+                        "order": 1,
+                        "description": "Name of report in DV360, should be unique."
+                    }
+                }
+            },
+            "out": {
+                "bigquery": {
+                    "dataset": {
+                        "field": {
+                            "name": "recipe_name",
+                            "kind": "string",
+                            "order": 1,
+                            "default": "ITP_Audit_Dashboard",
+                            "description": "BigQuery dataset for store dashboard tables."
+                        }
+                    },
+                    "table": "z_Dv360_Browser_Report_Dirty"
+                }
+            }
+        }
+    },
+    {
+        "itp_audit": {
+            "auth": "service",
+            "account": {
+                "field": {
+                    "name": "cm_account_id",
+                    "kind": "string",
+                    "order": 2,
+                    "default": "",
+                    "description": "Campaign Manager Account Id."
+                }
+            },
+            "dataset": {
+                "field": {
+                    "name": "recipe_name",
+                    "kind": "string",
+                    "order": 1,
+                    "default": "ITP_Audit_Dashboard",
+                    "description": "BigQuery dataset for store dashboard tables."
+                }
+            },
+            "sheet": {
+                "field": {
+                    "name": "recipe_name",
+                    "prefix": "ITP Audit ",
+                    "kind": "string",
+                    "order": 1,
+                    "description": "Name of document to deploy to.",
+                    "default": ""
+                }
+            },
+            "timeout": 60
+        }
+    }
+]
+
+ +
+ +

+

Run This Workflow In Minutes On Google Cloud

+

Everything from a quick Google Cloud UI to reference developer code for your team in one GitHub repository.

+

+ + Deployment Stepslaunch + + + Developer Guidebuild + + + UI How Tolaptop + +

+ + + +
+ + + + + +
+ +
+ + + + + + + + + diff --git a/docs/solution/kv_uploader/index.html b/docs/solution/kv_uploader/index.html index 7d81ee21..f52203b6 100644 --- a/docs/solution/kv_uploader/index.html +++ b/docs/solution/kv_uploader/index.html @@ -294,7 +294,7 @@

policy  Tag Key Value Uploader

Age - Dec. 4, 2019 (6 months, 2 weeks) + Dec. 4, 2019 (6 months, 3 weeks) diff --git a/docs/solution/manual/index.html b/docs/solution/manual/index.html index b0e1a082..04bd5370 100644 --- a/docs/solution/manual/index.html +++ b/docs/solution/manual/index.html @@ -190,7 +190,7 @@

notifications  Test Script

Age - July 17, 2019 (11 months) + July 17, 2019 (11 months, 1 week) diff --git a/docs/solution/monthly_budget_mover/index.html b/docs/solution/monthly_budget_mover/index.html index e6319aa8..8cead9a6 100644 --- a/docs/solution/monthly_budget_mover/index.html +++ b/docs/solution/monthly_budget_mover/index.html @@ -291,7 +291,7 @@

perm_phone_msg  Monthly Budget Mov Age - May 23, 2019 (1 year) + May 23, 2019 (1 year, 1 month) @@ -378,16 +378,80 @@

perm_phone_msg  Monthly Budget Mov } } }, + { + "dbm": { + "auth": "user", + "report": { + "timeout": 90, + "filters": { + "FILTER_ADVERTISER": { + "values": { + "field": { + "name": "filter_ids", + "kind": "integer_list", + "order": 7, + "default": "", + "description": "The comma separated list of Advertiser Ids." + } + } + } + }, + "body": { + "timezoneCode": { + "field": { + "name": "recipe_timezone", + "kind": "timezone", + "description": "Timezone for report dates.", + "default": "America/Los_Angeles" + } + }, + "metadata": { + "title": { + "field": { + "name": "recipe_name", + "kind": "string", + "prefix": "Monthly_Budget_Mover_", + "order": 1, + "description": "Name of report in DV360, should be unique." + } + }, + "dataRange": "PREVIOUS_MONTH", + "format": "CSV" + }, + "params": { + "type": "TYPE_GENERAL", + "groupBys": [ + "FILTER_ADVERTISER_CURRENCY", + "FILTER_INSERTION_ORDER" + ], + "metrics": [ + "METRIC_REVENUE_ADVERTISER" + ] + } + } + }, + "delete": false + } + }, { "monthly_budget_mover": { "auth": "user", - "spend_report_id": { + "is_colab": { "field": { - "name": "spend_report_id", + "name": "is_colab", + "kind": "boolean", + "default": true, + "order": 7, + "description": "Are you running this in Colab? (This will store the files in Colab instead of Bigquery)" + } + }, + "report_name": { + "field": { + "name": "recipe_name", "kind": "string", - "order": 2, - "default": "", - "description": "The report Id for the DV360 spend report." + "prefix": "Monthly_Budget_Mover_", + "order": 1, + "description": "Name of report in DV360, should be unique." } }, "budget_categories": { @@ -395,8 +459,8 @@

perm_phone_msg  Monthly Budget Mov "name": "budget_categories", "kind": "json", "order": 3, - "default": "{\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}", - "description": "A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format." + "default": "{}", + "description": "A dictionary to show which IO Ids go under which Category. {\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}" } }, "excluded_ios": { @@ -409,68 +473,130 @@

perm_phone_msg  Monthly Budget Mov }, "sdf": { "auth": "user", - "file_types": "INSERTION_ORDER", - "filter_type": { + "version": { "field": { - "name": "filter_type", + "name": "version", "kind": "choice", "order": 6, - "default": "", - "description": "The filter type for the filter ids.", + "default": "5", + "description": "The sdf version to be returned.", "choices": [ - "ADVERTISER_ID", - "CAMPAIGN_ID", - "INSERTION_ORDER_ID", - "INVENTORY_SOURCE_ID", - "LINE_ITEM_ID", - "PARTNER_ID" + "SDF_VERSION_5", + "SDF_VERSION_5_1" ] } }, - "filter_ids": { + "partner_id": { "field": { - "name": "filter_ids", - "kind": "integer_list", - "order": 7, - "default": "", - "description": "The filter ids for the request." + "name": "partner_id", + "kind": "integer", + "order": 1, + "description": "The sdf file types." } - } - }, - "out": { + }, + "file_types": "INSERTION_ORDER", + "filter_type": "FILTER_TYPE_ADVERTISER_ID", + "read": { + "filter_ids": { + "single_cell": true, + "values": { + "field": { + "name": "filter_ids", + "kind": "integer_list", + "order": 4, + "default": [], + "description": "Comma separated list of filter ids for the request." + } + } + } + }, + "time_partitioned_table": false, + "create_single_day_table": false, "dataset": { "field": { "name": "dataset", "kind": "string", - "order": 8, + "order": 6, "default": "", - "description": "Dataset that you would like your output tables to be produced in." + "description": "Dataset to be written to in BigQuery." } }, - "old_sdf_table_name": { - "field": { - "name": "recipe_name", - "kind": "string", - "prefix": "SDF_OLD_", - "description": "" - } + "table_suffix": "" + }, + "out_old_sdf": { + "bigquery": { + "dataset": { + "field": { + "name": "dataset", + "kind": "string", + "order": 8, + "default": "", + "description": "Dataset that you would like your output tables to be produced in." + } + }, + "table": { + "field": { + "name": "recipe_name", + "kind": "string", + "prefix": "SDF_OLD_", + "description": "" + } + }, + "schema": [], + "skip_rows": 0, + "disposition": "WRITE_TRUNCATE" }, - "new_sdf_table_name": { - "field": { - "name": "recipe_name", - "kind": "string", - "prefix": "SDF_NEW_", - "description": "" - } + "file": "/content/old_sdf.csv" + }, + "out_new_sdf": { + "bigquery": { + "dataset": { + "field": { + "name": "dataset", + "kind": "string", + "order": 8, + "default": "", + "description": "Dataset that you would like your output tables to be produced in." + } + }, + "table": { + "field": { + "name": "recipe_name", + "kind": "string", + "prefix": "SDF_NEW_", + "description": "" + } + }, + "schema": [], + "skip_rows": 0, + "disposition": "WRITE_TRUNCATE" }, - "changes_table_name": { - "field": { - "name": "recipe_name", - "kind": "string", - "prefix": "SDF_BUDGET_MOVER_LOG_", - "description": "" - } - } + "file": "/content/new_sdf.csv" + }, + "out_changes": { + "bigquery": { + "dataset": { + "field": { + "name": "dataset", + "kind": "string", + "order": 8, + "default": "", + "description": "Dataset that you would like your output tables to be produced in." + } + }, + "table": { + "field": { + "name": "recipe_name", + "kind": "string", + "prefix": "SDF_BUDGET_MOVER_LOG_", + "description": "" + } + }, + "schema": [], + "skip_rows": 0, + "disposition": "WRITE_TRUNCATE" + }, + "file": "/content/log.csv" } } } diff --git a/docs/solution/policebot/index.html b/docs/solution/policebot/index.html index 004032ae..da59541e 100644 --- a/docs/solution/policebot/index.html +++ b/docs/solution/policebot/index.html @@ -302,7 +302,7 @@

policy  PoliceBot

Age - Aug. 28, 2019 (9 months, 3 weeks) + Aug. 28, 2019 (9 months, 4 weeks) diff --git a/docs/solution/salesforce_to_bigquery/index.html b/docs/solution/salesforce_to_bigquery/index.html index fc3536b5..49da39a8 100644 --- a/docs/solution/salesforce_to_bigquery/index.html +++ b/docs/solution/salesforce_to_bigquery/index.html @@ -194,7 +194,7 @@

donut_large  Salesforce To BigQuer Age - Jan. 22, 2020 (4 months, 3 weeks) + Jan. 22, 2020 (5 months) diff --git a/docs/solution/smartsheet_to_bigquery/index.html b/docs/solution/smartsheet_to_bigquery/index.html index 4539d67c..c8efc3db 100644 --- a/docs/solution/smartsheet_to_bigquery/index.html +++ b/docs/solution/smartsheet_to_bigquery/index.html @@ -194,7 +194,7 @@

donut_large  SmartSheet To BigQuer Age - Jan. 23, 2020 (4 months, 3 weeks) + Jan. 23, 2020 (5 months) diff --git a/docs/solution/transparency/index.html b/docs/solution/transparency/index.html index 7f5435bf..6358c18e 100644 --- a/docs/solution/transparency/index.html +++ b/docs/solution/transparency/index.html @@ -296,7 +296,7 @@

fingerprint  Transparency Dashboar Age - Aug. 19, 2019 (10 months) + Aug. 19, 2019 (10 months, 1 week) diff --git a/docs/solution/video/index.html b/docs/solution/video/index.html index f4d15b05..48c369d7 100644 --- a/docs/solution/video/index.html +++ b/docs/solution/video/index.html @@ -196,7 +196,7 @@

switch_video  Video Overlay

Age - July 31, 2019 (10 months, 2 weeks) + July 31, 2019 (10 months, 3 weeks) diff --git a/starthinker/task/itp_audit/run.py b/starthinker/task/itp_audit/run.py index 810f8014..1e786450 100644 --- a/starthinker/task/itp_audit/run.py +++ b/starthinker/task/itp_audit/run.py @@ -24,20 +24,21 @@ from starthinker.util.dcm import report_delete, report_build, report_file, report_to_rows, report_clean, report_schema, report_run from starthinker.util.sheets import sheets_read, sheets_clear, sheets_write from starthinker.task.sdf.run import sdf +from starthinker.task.itp_audit.queries import Queries SQL_DIRECTORY = 'sql/' # Queries -CLEAN_BROWSER_REPORT_FILENAME = 'clean_browser_report.sql' -BROWSER_PERFORMANCE_2YEARS_FILENAME = 'browser_performance_2years.sql' -SAFARI_DISTRIBUTION_90DAYS_FILENAME = 'safari_distribution_90days.sql' -DV360_BROWSER_SHARES_MULTICHART_FILENAME = 'browser_share_multichart.sql' -CM_SEGMENTATION_FILENAME ='CM_Segmentation.sql' -CM_SITE_SEGMENTATION_FILENAME = 'CM_Site_Segmentation.sql' -CM_FLOODLIGHT_JOIN_FILENAME = 'CM_Floodlight_Join.sql' -CM_FLOODLIGHT_MULTICHART_FILENAME = 'CM_Floodlight_Multichart.sql' -SDF_JOIN_FILENAME = 'sdf_join.sql' -DV360_CUSTOM_SEGMENTS_FILENAME = 'DV360_Custom_Segments.sql' +# CLEAN_BROWSER_REPORT_FILENAME = 'clean_browser_report.sql' +# BROWSER_PERFORMANCE_2YEARS_FILENAME = 'browser_performance_2years.sql' +# SAFARI_DISTRIBUTION_90DAYS_FILENAME = 'safari_distribution_90days.sql' +# DV360_BROWSER_SHARES_MULTICHART_FILENAME = 'browser_share_multichart.sql' +# CM_SEGMENTATION_FILENAME ='CM_Segmentation.sql' +# CM_SITE_SEGMENTATION_FILENAME = 'CM_Site_Segmentation.sql' +# CM_FLOODLIGHT_JOIN_FILENAME = 'CM_Floodlight_Join.sql' +# CM_FLOODLIGHT_MULTICHART_FILENAME = 'CM_Floodlight_Multichart.sql' +# SDF_JOIN_FILENAME = 'sdf_join.sql' +# DV360_CUSTOM_SEGMENTS_FILENAME = 'DV360_Custom_Segments.sql' # Output Tables BROWSER_PERFORMANCE_2YEARS_TABLE = 'DV3_Browser' @@ -67,18 +68,18 @@ def itp_audit(): # CM Segmentation Query if project.verbose: print('RUN CM Segmentation Query') - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + CM_SEGMENTATION_FILENAME), project.id, project.task['dataset'], CM_BROWSER_REPORT_CLEAN_TABLE) + run_query_from_file(Queries.cm_segmentation, project.id, project.task['dataset'], CM_BROWSER_REPORT_CLEAN_TABLE) run_cm_queries(project) def run_cm_queries(project): # CM Floodlight Lookup Table - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + CM_FLOODLIGHT_JOIN_FILENAME), project.id, project.task['dataset'], CM_FLOODLIGHT_TABLE) + run_query_from_file(Queries.cm_floodlight_join, project.id, project.task['dataset'], CM_FLOODLIGHT_TABLE) # Floodlight Multichart if project.verbose: print('RUN CM Floodlight Multichart') - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + CM_FLOODLIGHT_MULTICHART_FILENAME), + run_query_from_file(Queries.cm_floodlight_multichart, project.id, project.task['dataset'], CM_FLOODLIGHT_MULTICHART_TABLE) @@ -90,21 +91,21 @@ def run_dv_360_queries(project): create_dv360_segments(project) # Clean DV360 Browser Report - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + CLEAN_BROWSER_REPORT_FILENAME), project.id, project.task['dataset'], CLEAN_BROWSER_REPORT_TABLE) + run_query_from_file(Queries.clean_browser_report, project.id, project.task['dataset'], CLEAN_BROWSER_REPORT_TABLE) # Browser Performance 2 years if project.verbose: print('RUN Browser Performance 2 years Query') - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + BROWSER_PERFORMANCE_2YEARS_FILENAME), + run_query_from_file(Queries.browser_2_year, project.id, project.task['dataset'], BROWSER_PERFORMANCE_2YEARS_TABLE) #Safari Distribution 90 days if project.verbose: print('RUN Safari Distribution 90 days Query') - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + SAFARI_DISTRIBUTION_90DAYS_FILENAME), + run_query_from_file(Queries.safari_distribution_90days, project.id, project.task['dataset'], SAFARI_DISTRIBUTION_90DAYS_TABLE) # Browser Shares Multichart if project.verbose: print('RUN Dv360 Browser Share Multichart') - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + DV360_BROWSER_SHARES_MULTICHART_FILENAME), + run_query_from_file(Queries.browser_share_multichart, project.id, project.task['dataset'], DV360_BROWSER_SHARES_MULTICHART_TABLE) @@ -145,22 +146,9 @@ def create_dv360_segments(project): ) # Run Query - path = os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + DV360_CUSTOM_SEGMENTS_FILENAME) - query = '' - with open(path, 'r') as file: - data = file.read().replace('\n', ' ') - query = data.replace("{{project_id}}", project.id).replace("{{dataset}}", project.task['dataset']) - - print('DV360 CUSTOM SEGMENT TABLE') - - query_to_table( - 'service', - project.id, - project.task['dataset'], - DV360_CUSTOM_SEGMENTS_TABLE, - query, - legacy=False - ) + if project.verbose: print('RUN DV360 Custom Segments Query') + run_query_from_file(Queries.dv360_custom_segments, + project.id, project.task['dataset'], DV360_CUSTOM_SEGMENTS_TABLE) # Move Table back to sheets query = 'SELECT * from `' + project.id + '.' + project.task['dataset'] + '.' + DV360_CUSTOM_SEGMENTS_TABLE + '`' @@ -200,7 +188,7 @@ def create_cm_site_segmentation(project): ) # Get Site_Type from the sheet - run_query_from_file(os.path.join(os.path.dirname(__file__), SQL_DIRECTORY + CM_SITE_SEGMENTATION_FILENAME), project.id, project.task['dataset'], CM_SITE_SEGMENTATION_TABLE) + run_query_from_file(Queries.cm_site_segmentation, project.id, project.task['dataset'], CM_SITE_SEGMENTATION_TABLE) # Move Table back to sheets query = 'SELECT * from `' + project.id + '.' + project.task['dataset'] + '.' + CM_SITE_SEGMENTATION_TABLE + '`' @@ -212,11 +200,8 @@ def create_cm_site_segmentation(project): sheets_write('user', project.task['sheet'], 'CM_Site_Segments', 'A2:C', rows) -def run_query_from_file(path, project_id, dataset, table_name): - query = '' - with open(path, 'r') as file: - data = file.read().replace('\n', ' ') - query = data.replace("{{project_id}}", project_id).replace("{{dataset}}", dataset) +def run_query_from_file(query, project_id, dataset, table_name): + query = query.replace('\n', ' ').replace("{{project_id}}", project_id).replace("{{dataset}}", dataset) query_to_table( 'service', diff --git a/tests/scripts/itp.json b/tests/scripts/itp.json deleted file mode 100644 index 3ea5f0e0..00000000 --- a/tests/scripts/itp.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "setup":{ - "license":"Apache License, Version 2.0", - "copyright":"Copyright 2020 Google LLC" - }, - "tasks": [ - { "include":{ - "script":"scripts/itp.json", - "parameters":{ - "dataset":"Test", - "dcm_account":{"field":{ "name":"dcm_account", "kind":"integer", "description":"DCM account id of client." }}, - "dcm_advertisers":{"field":{ "name":"dcm_advertisers", "kind":"integer_list", "description":"Comma delimited list of DCM advertiser ids." }}, - "dcm_floodlight":{"field":{ "name":"dcm_floodlight", "kind":"integer", "description":"DCM floodlight configuration id." }}, - "dbm_partners":{"field":{ "name":"dbm_partners", "kind":"integer_list", "description":"DBM partner id." }}, - "dbm_advertisers":{"field":{ "name":"dbm_advertisers", "kind":"integer_list", "description":"Comma delimited list of DBM advertiser ids." }} - } - }}, - { "test": { - "assert":"Completed all tasks." - }} - ] -} diff --git a/tutorials/deploy_colab.md b/tutorials/deploy_colab.md index ef768b0b..1db5e7d1 100644 --- a/tutorials/deploy_colab.md +++ b/tutorials/deploy_colab.md @@ -46,13 +46,14 @@ All StarThinker recipes and solutions can be run from [Google Collaboratory](htt * [API To BigQuery](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/google_api_to_bigquery.ipynb) - Execute a Google API function and store results to BigQuery. * [Say Hello](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/hello.ipynb) - Recipe template for say hello. * [Project IAM](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/iam.ipynb) - Sets project permissions for an email. -* [Browser Activity Dashboard ( 2019 )](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/itp.ipynb) - Visualizes a client's Campaign Manager and DV360 activity by browser and device +* [ITP Audit Dashboard ( 2020 )](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/itp_audit.ipynb) - Dashboard that shows performance metrics across browser to see the impact of ITP. * [Tag Key Value Uploader](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/kv_uploader.ipynb) - A tool for bulk editing key value pairs for CM placements. * [Line Item To BigQuery Via Query](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/lineitem_read_to_bigquery_via_query.ipynb) - Move using an Id query. * [Line Item To BigQuery Via Values](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/lineitem_read_to_bigquery_via_value.ipynb) - Move using hard coded Id values. * [Line Item From BigQuery](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/lineitem_write_from_bigquery.ipynb) - Upload Line Items From BigQuery To DV360. * [Test Script](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/manual.ipynb) - Used by tests. * [Column Mapping](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/mapping.ipynb) - Use sheet to define keyword to column mappings. +* [Monthly Budget Mover](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/monthly_budget_mover.ipynb) - Apply the previous month's budget/spend delta to the current month. Aggregate up the budget and spend from the previous month of each category declared then apply the delta of the spend and budget equally to each Line Item under that Category. * [PoliceBot](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/policebot.ipynb) - A tool that helps enforce CM object name conventions by checking names against a set of client-defined patterns, and emailing violations to appropriate agency teams on a daily basis. * [Salesforce To BigQuery](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/salesforce_to_bigquery.ipynb) - Move query results into a BigQuery table. * [SDF Download](https://colab.research.google.com/github/google/starthinker/blob/master/colabs/sdf_to_bigquery.ipynb) - Download SDF reports into a BigQuery table.