Script 195: Kwds Pause
Purpose
The Python script processes keyword data to manage and update advertising campaign statuses based on specific criteria.
To Elaborate
The script is designed to handle keyword data for advertising campaigns, focusing on managing and updating the status of these campaigns. It processes input data, likely from a report, to determine which keywords should be paused or adjusted based on their performance metrics. The script uses specific columns from the input data, such as keyword, publication cost, conversion rate, clicks, impressions, and conversions, to evaluate the effectiveness of each keyword. The goal is to optimize the advertising budget by pausing underperforming keywords, thereby improving the overall efficiency of the campaign. The script allows for structured budget allocation (SBA) by ensuring that resources are directed towards the most effective keywords.
Walking Through the Code
- Initialization of Constants
- The script begins by defining constants for various column names used in the input and output data. These constants represent key metrics such as keywords, publication cost, conversion rate, clicks, impressions, and conversions. These constants are crucial for identifying and processing the relevant data fields.
- Setting Output DataFrame Values
- The script sets default values for several columns in the output DataFrame, including account, group, match type, and status. These placeholders (
"<<YOUR VALUE>>"
) indicate that the user should input specific values relevant to their campaign setup. This step is essential for customizing the output based on user-specific campaign details.
- The script sets default values for several columns in the output DataFrame, including account, group, match type, and status. These placeholders (
- Data Processing and Output
- Although not fully detailed in the provided code, the script likely processes the input DataFrame to evaluate keyword performance based on the defined metrics. The processed data is then formatted and printed using a function like
tableize
, which organizes the data into a readable table format. This step is crucial for visualizing the results and making informed decisions about keyword management.
- Although not fully detailed in the provided code, the script likely processes the input DataFrame to evaluate keyword performance based on the defined metrics. The processed data is then formatted and printed using a function like
Vitals
- Script ID : 195
- Client ID / Customer ID: 309909744 / 14196
- Action Type: Bulk Upload (Preview)
- Item Changed: Keyword
- Output Columns: Account, Campaign, Group, Keyword, Match Type, Status
- Linked Datasource: M1 Report
- Reference Datasource: None
- Owner: emerryfield@marinsoftware.com (emerryfield@marinsoftware.com)
- Created by emerryfield@marinsoftware.com on 2023-06-15 17:21
- Last Updated by emerryfield@marinsoftware.com on 2023-12-06 04:01
> See it in Action
Python Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
RPT_COL_KEYWORD = 'Keyword'
RPT_COL_PUB_COST = 'Pub. Cost $'
RPT_COL_CONV_RATE = 'Conv. Rate %'
RPT_COL_CLICKS = 'Clicks'
RPT_COL_IMPR = 'Impr.'
RPT_COL_CAMPAIGN = 'Campaign'
RPT_COL_CONV = 'Conv.'
BULK_COL_ACCOUNT = 'Account'
BULK_COL_CAMPAIGN = 'Campaign'
BULK_COL_GROUP = 'Group'
BULK_COL_KEYWORD = 'Keyword'
BULK_COL_MATCH_TYPE = 'Match Type'
BULK_COL_STATUS = 'Status'
outputDf[BULK_COL_ACCOUNT] = "<<YOUR VALUE>>"
outputDf[BULK_COL_GROUP] = "<<YOUR VALUE>>"
outputDf[BULK_COL_MATCH_TYPE] = "<<YOUR VALUE>>"
outputDf[BULK_COL_STATUS] = "<<YOUR VALUE>>"
today = datetime.datetime.now(CLIENT_TIMEZONE).date()
print(tableize(inputDf))
Post generated on 2024-11-27 06:58:46 GMT