dscigametrics.find_campaigns
Module Contents
Functions
|
Analyzes and identifies the best and worst performing marketing campaigns based on a selected metric |
- dscigametrics.find_campaigns.find_campaigns(data, start_date, end_date, campaign_ids, metric)[source]
Analyzes and identifies the best and worst performing marketing campaigns based on a selected metric
- Parameters:
data (dataframe) – Dataframe containing information from google analytics
start_date (int or timestamp) – The start date for the analysis period.
end_date (int or timestamp) – The end date for the analysis period.
campaign_ids (list of int) – A list of campaign IDs to be analyzed.
metric (str) – The name of the metric to be used for evaluating campaign performance.
- Returns:
A dictionary containing two key-value pairs - ‘best_campaign’ and ‘worst_campaign’.
- Return type:
dict
Examples
output_dict = find_best_and_worst_campaigns(data, 20220801, 20220825, [219011657, 140569061, 215934049, 123851219], ‘conversion_rate’) result: {‘best_campaign’: {‘id’: 123851219, ‘value’: 0.116}, ‘worst_campaign’: {‘id’: 219011657, ‘value’: 0.056}}