{"id":19913397,"url":"https://github.com/morphl-ai/ecommerce-marketing-spend-optimization","last_synced_at":"2025-05-03T05:30:25.778Z","repository":{"id":37743646,"uuid":"248053210","full_name":"Morphl-AI/Ecommerce-Marketing-Spend-Optimization","owner":"Morphl-AI","description":"Marketing Budget Optimization for Online Retailers using AI \u0026 Machine Learning.","archived":false,"fork":false,"pushed_at":"2020-04-23T07:47:23.000Z","size":31159,"stargazers_count":68,"open_issues_count":3,"forks_count":36,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-02-24T17:35:10.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Morphl-AI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-17T19:13:33.000Z","updated_at":"2024-02-18T06:11:12.000Z","dependencies_parsed_at":"2022-09-13T19:21:25.098Z","dependency_job_id":null,"html_url":"https://github.com/Morphl-AI/Ecommerce-Marketing-Spend-Optimization","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morphl-AI%2FEcommerce-Marketing-Spend-Optimization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morphl-AI%2FEcommerce-Marketing-Spend-Optimization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morphl-AI%2FEcommerce-Marketing-Spend-Optimization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Morphl-AI%2FEcommerce-Marketing-Spend-Optimization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Morphl-AI","download_url":"https://codeload.github.com/Morphl-AI/Ecommerce-Marketing-Spend-Optimization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224352926,"owners_count":17297171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T21:32:55.997Z","updated_at":"2024-11-12T21:32:56.075Z","avatar_url":"https://github.com/Morphl-AI.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Budget Optimization for Online Retailers\n\n## 1. Context (COVID-19)\nMorphL is an AI platform for e-commerce companies which in essence consists of a suite of machine learning models that are platform agnostic, that can be used across the customer journey and, of course, across the organization. One of these models offers online retailers the ability to optimize their budget allocation across multiple channels with the end goal of maximizing their revenues. \n\nDuring COVID-19 crisis and in the spirit of #givefirst we decided to open-source the “E-commerce Budget Optimization” model and offer it for FREE to online retailers out there.\n\nThis initiative consists of the following activities/resources:\n\n* A series of live AI \u0026 ML webinars taking place every Monday at 1PM (GMT+2): https://www.crowdcast.io/e/Ecommerce-Marketing-Spend-Optimization\n\n* Kickoff Meeting Presentation: https://bit.ly/budget-optimization-kickoff\n\n* Google Analytics Custom Report: https://bit.ly/ga-bo-report\n\n* Slack invite: https://bit.ly/morphl-slack-invite\n\n\n## 2. Introduction \n\nThe business problem can be expressed in the following manner: given a total budget B, calculate the optimum monthly budget  allocation {B1, ..., B12} across multiple channels (and potentially campaigns {C1, ..., Cn}) in order to maximize revenue R.\n\nHere's a very basic [Marketing Budget Allocation Planning](https://bit.ly/marketing-budget-allocation) that assumes Year to Date (YTD) average Cost-per-Click (CPC), Conversion Rate (CVR) and Average Order Value (AOV) for each channel.\n\nWhile the task is to optimize the budget allocation between multiple channels \u0026 campaigns, some of them are \"inner\" optimizable (Google Ads, Facebook Ads), others are out of reach: E-mail, SEO, etc. There are multiple \"problems\" at once that are embedded in this \"budget allocation\" term and we’ll try to provide a direction to solving the problem using the campaigns as black-boxes, making use only of the cost and the revenue produced.\n\n## 3. Budget Allocation Overview\n\nFirst of all, in the perfect scenario, where we got a set of Campaigns {C1, ..., Cn} with a perfectly\nexplainable function Budget(i) → Revenue(i), for i ∈ Campaigns, the task is trivial to solve. However, campaigns are most likely not a linear function of Budget, meaning that investing too\nlittle or too much would cause non-linearities.\n\nThe main issue here is that there are some hard assumptions about the Projected Revenues,\nwhich are probably hand picked. We’ve got a small time series and we can know for\neach day (Google Ads Daily/Facebook Ads Daily) and month how much we invested and how much revenue we've got. \n\nWe can, thus, predict how much the daily/monthly revenue we'll have, given the historical data. This will automatically give a model where we can predict for each campaign and given budget an estimated revenue return.\n\nAnother observable fact is that picking the weights for all campaigns relatively close to each\nother {0.2857, 0.3174, 0.3968}, meaning putting all eggs\nin one basket (best performing one), is wrong. We could alter the weights to be close to each other\nusing a regularization technique, while also allowing favouring the best performing one.\n\nThus, the task is divided into 2 parts.\n• Computing a model (B → Rev) for each Campaign\n• Compute a optimal budget allocation, given the models for each Campaign\n\n### 3.1 Time Series Model\nWe can build a daily and a monthly model (and probably any other interval we desire, but for\nsimplicity let’s keep only these). This is the simplest model, where each campaign (C) is a black box. We’re trying to define the dependency between the allocated budget (B), and the historical data of this campaign, to predict\nthe revenue of the campaign.\n\nRevC (ti) = P(B|RevC (t0), . . . RevC (ti−1))\n\nHow we model this is irrelevant (RNN, HMM or even a linear model). Once we have it, we can, in\ntheory make a Rev = f(B) estimation for each campaign.\n\nFor the task of computing a model for each Campaign, we can use:\n\n* Monthly aggregated data. This is the easiest case, however I propose this as the baseline\nsolution\n\n* Daily data. Use the daily data to model the time series, which should show some improvements\nover the baseline solution. \n\n### 3.2 Optimal Optimization Problem\nOnce we have a model for each campaign, we can solve the problem of picking the optimal budget allocation. The revenue plots for each campaign could look like this:\n\n![Sample Plots](https://raw.githubusercontent.com/Morphl-AI/Ecommerce-Marketing-Spend-Optimization/master/Images/sample-plots.png)\n\nThe yellow line represents the cumulative sum (return/revenue) given the budget. Clearly, this is a monotonically increasing\nfunction (we get more money as we pour more money, however potentially sub optimal). The blue\nline is the relation between the budget and the returning sum. This tells us how much\nwe should optimally invest in each campaign, thus we can infer how much we should allocate\nfor each marketing channel, resulting in the optimal solution.\n\nWe observe that even for dummy data, once we make the models non-linear, the global optimum\nvaries greatly. We thus propose a solution based on various non convex continuous\noptimization algorithms, such as genetic algorithms and colony optimization.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorphl-ai%2Fecommerce-marketing-spend-optimization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorphl-ai%2Fecommerce-marketing-spend-optimization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorphl-ai%2Fecommerce-marketing-spend-optimization/lists"}