Imagine working for a digital marketing agency, and the agency is approached by a massive online furniture retailer. They want to test your skills at creating large campaigns for all of their website. You are tasked with creating a prototype set of keywords for search campaigns for their sofas section. The client says that they want you to generate keywords for the following products:
- sofas
- convertible sofas
- love seats
- recliners
- sofa beds
The client is a low-cost retailer, offering many promotions and discounts. You will need to focus on such keywords. You will also need to move away from luxury keywords and topics, as you are targeting price-sensitive customers. Because they are going to be tight on budget, it would be good to focus on a tightly targeted set of keywords and make sure they are all set to exact and phrase match.
Based on the brief above you will first need to generate a list of words, that together with the products given above would make for good keywords. Here are some examples:
- Products: sofas, recliners
- Words: buy, prices
The resulting keywords: 'buy sofas', 'sofas buy', 'buy recliners', 'recliners buy', 'prices sofas', 'sofas prices', 'prices recliners', 'recliners prices'.
As a final result, you want to have a DataFrame that looks like this:
| Campaign | Ad Group | Keyword | Criterion Type |
|---|---|---|---|
| Campaign1 | AdGroup_1 | keyword 1a | Exact |
| Campaign1 | AdGroup_1 | keyword 1b | Exact |
| Campaign1 | AdGroup_2 | keyword 2a | Exact |
Project Instructions
What keywords would help the client sell the listed products through search campaigns?
Save at least 60 unique keywords as a DataFrame called keywords_df and a CSV file called keywords.csv.
Both of these should contain four columns:
- Ad Group: containing the product names
- Keyword: containing the product and keyword combinations, combined in both directions (word + product, and product + word)
- Campaign: with the value SEM_Sofas in every row
- Criterion Type: with the value Exact in every row.
import pandas as pd
# List of words to pair with products
words = ['buy', 'price', 'discount', 'promotion', 'promo', 'shop']
# Print list of words
print(words)
products = ['sofas', 'convertible sofas', 'love seats', 'recliners', 'sofa beds']
# Create an empty list
keywords_list = []
# Loop through products
for product in products:
# Loop through words
for word in words:
# Append combinations
keywords_list.append([product, product + ' ' + word])
keywords_list.append([product, word + ' ' + product])
# Inspect keyword list
print()
print(keywords_list)
print()
# Create a DataFrame from list
keywords_df = pd.DataFrame(keywords_list, columns=['Ad Group', 'Keyword'])
# Print the keywords DataFrame to explore it
print(keywords_df)
# Add a campaign column
keywords_df['Campaign'] = 'SEM_Sofas'
# Add a criterion type column
keywords_df['Criterion Type'] = 'Exact'
print()
print(keywords_df)
# Save the final keywords to a CSV file
keywords_df.to_csv('keywords.csv', index=False)