The StarThinker project will no longer receive new solution contributions from the Google team.
Please read the full StarThinker Open Source Support Ends At Google article for more details.



All

perm_phone_msg

DV360 Monthly Budget Mover

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.

DV360 Monthly Budget Mover Sample Screenshot


lock_openGet Access listGit Hub sourcePython menu_bookColab airAirflow



Impact Level

Spend Optimization
Spend Growth
Time Savings
Account Health
Csat Improvement
Technical Level

Value Proposition

Saves on the time to manually move Insertion Order budgets from month to month.
Allows you to categorize line items into categories, then the tool will aggregate up all the spend and budget for those line items and determine any remaining or negative budget. Then it will spread that amount equally across all of the Line Items in that category.

Instructions

No changes made can be made in DV360 from the start to the end of this process
Make sure there is budget information for the current and previous month's IOs in DV360
Make sure the provided spend report has spend data for every IO in the previous month
Spend report must contain 'Revenue (Adv Currency)' and 'Insertion Order ID'
There are no duplicate IO Ids in the categories outlined below
This process must be ran during the month of the budget it is updating
If you receive a 502 error then you must separate your jobs into two, because there is too much information being pulled in the sdf
Manually run this job
Once the job has completed go to the table for the new sdf and export to a csv
Take the new sdf and upload it into DV360

Details

Open Source YES
Age May 23, 2019 (3 years, 7 months)
Authors terwilleger@google.com
Shedule Days Configured by user.
Shedule Hours 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
[
    {
        "dataset": {
            "description": "Create a dataset where data will be combined and transfored for upload.",
            "auth": {
                "field": {
                    "name": "auth_write",
                    "kind": "authentication",
                    "order": 1,
                    "default": "service",
                    "description": "Credentials used for writing data."
                }
            },
            "dataset": {
                "field": {
                    "name": "dataset",
                    "kind": "string",
                    "order": 1,
                    "description": "Place where tables will be created in BigQuery."
                }
            }
        }
    },
    {
        "dbm": {
            "auth": {
                "field": {
                    "name": "auth_read",
                    "kind": "authentication",
                    "order": 1,
                    "default": "user",
                    "description": "Credentials used for reading data."
                }
            },
            "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",
            "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)"
                }
            },
            "report_name": {
                "field": {
                    "name": "recipe_name",
                    "kind": "string",
                    "prefix": "Monthly_Budget_Mover_",
                    "order": 1,
                    "description": "Name of report in DV360, should be unique."
                }
            },
            "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]}"
                }
            },
            "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"
                }
            },
            "sdf": {
                "auth": "user",
                "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"
                        ]
                    }
                },
                "partner_id": {
                    "field": {
                        "name": "partner_id",
                        "kind": "integer",
                        "order": 1,
                        "description": "The sdf file types."
                    }
                },
                "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": 6,
                        "default": "",
                        "description": "Dataset to be written to in BigQuery."
                    }
                },
                "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": "Table to write to."
                        }
                    },
                    "schema": [],
                    "skip_rows": 0,
                    "disposition": "WRITE_TRUNCATE"
                },
                "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": "Table to write to."
                        }
                    },
                    "schema": [],
                    "skip_rows": 0,
                    "disposition": "WRITE_TRUNCATE"
                },
                "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": "Table to write to."
                        }
                    },
                    "schema": [],
                    "skip_rows": 0,
                    "disposition": "WRITE_TRUNCATE"
                },
                "file": "/content/log.csv"
            }
        }
    }
]


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