You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Meridian validates that media channel names must be unique across media_channel and rf_channel, throwing a ValueError if there are duplicate channel names. However, as far as I can tell, this check is happening on the post-mapping channel names, not the variable names themselves. This causes an issue when trying to map multiple variables in the raw data to one 'channel', as the mappings are considered duplicates.
To be clear, I am referring to the mapping done in the correct_media_to_channel and correct_spend_to_channel dictionaries.
Use Case
In marketing analytics generally, and definitely in my personal case at work, we commonly split out variables for a channel by year, half-year or quarter to try and capture differences in performance. For example, Google_Ads_2022, Google_Ads_2023 and Google_Ads_2024 would be 3 different variables in the model, but all pertain to one channel (Google Ads). Usually, we manually roll up the contributions of these variables for analysis and reporting purposes after the model has been built. Other reasons for splitting variables within the same channel could be:
Multiple campaigns/tactics for the same channel (e.g., "Baidu_Keywords" and "Baidu_Static" both representing different Baidu tactics)
Different creative types or targeting approaches within the same channel
When I saw the option to map variables to channels for final reporting, I assumed that this is what was meant. However, I now realize that this is probably just to allow linking impression and spend variables together (happy to be corrected if there is another reason for it).
Proposed Solution
Consider adding support for intentional many-to-one mapping of media variables to channels. This could be through:
A configuration parameter to allow duplicate channel names when they come from mapped variables (could be switched off by default to preserve current behaviour)
Automatic aggregation of variables mapped to the same channel (less ideal)
This would make things a lot more flexible for scenarios where data granularity differs from the necessary reporting granularity. The idea would be to aggregate contributions and spend across the sub-variables that map to a common channel, and then report on metrics like ROI, contribution, CPIK etc. at the aggregated level. Of course, this cannot apply to response curves, and I think by extension may not be able to apply to things like effectiveness and marginal ROI (less sure about that), but those elements can stay as they are.
Disclaimer - I am not qualified enough to try to submit a pull request for something like this, which is why I'm creating an issue instead to see if this is something that has wider appeal or something the team has under consideration. Thank you!
The text was updated successfully, but these errors were encountered:
aazimh
changed the title
Support many-to-one mapping of media variables to channels
[Feature request] Support many-to-one mapping of media variables to channels
Jan 30, 2025
Current Behavior
Currently, Meridian validates that media channel names must be unique across media_channel and rf_channel, throwing a ValueError if there are duplicate channel names. However, as far as I can tell, this check is happening on the post-mapping channel names, not the variable names themselves. This causes an issue when trying to map multiple variables in the raw data to one 'channel', as the mappings are considered duplicates.
To be clear, I am referring to the mapping done in the correct_media_to_channel and correct_spend_to_channel dictionaries.
Use Case
In marketing analytics generally, and definitely in my personal case at work, we commonly split out variables for a channel by year, half-year or quarter to try and capture differences in performance. For example, Google_Ads_2022, Google_Ads_2023 and Google_Ads_2024 would be 3 different variables in the model, but all pertain to one channel (Google Ads). Usually, we manually roll up the contributions of these variables for analysis and reporting purposes after the model has been built. Other reasons for splitting variables within the same channel could be:
When I saw the option to map variables to channels for final reporting, I assumed that this is what was meant. However, I now realize that this is probably just to allow linking impression and spend variables together (happy to be corrected if there is another reason for it).
Proposed Solution
Consider adding support for intentional many-to-one mapping of media variables to channels. This could be through:
This would make things a lot more flexible for scenarios where data granularity differs from the necessary reporting granularity. The idea would be to aggregate contributions and spend across the sub-variables that map to a common channel, and then report on metrics like ROI, contribution, CPIK etc. at the aggregated level. Of course, this cannot apply to response curves, and I think by extension may not be able to apply to things like effectiveness and marginal ROI (less sure about that), but those elements can stay as they are.
Disclaimer - I am not qualified enough to try to submit a pull request for something like this, which is why I'm creating an issue instead to see if this is something that has wider appeal or something the team has under consideration. Thank you!
The text was updated successfully, but these errors were encountered: