Skip to content

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:

CampaignAd GroupKeywordCriterion Type
Campaign1AdGroup_1keyword 1aExact
Campaign1AdGroup_1keyword 1bExact
Campaign1AdGroup_2keyword 2aExact
import pandas as pd
# Start coding here
import pandas as pd

# Create a DataFrame from the dictionary
product_names = ['Leather Sofa', 'Sectional Sofa', 'Recliner Sofa', 'Sleeper Sofa', 'Loveseat']
keywords = ['comfortable', 'modern', 'durable', 'stylish', 'affordable', 'cozy']

# Create an empty list to store the data
data = []

# Generate keyword combinations
for product in product_names:
    for keyword in keywords:
        data.append({
            'Ad Group': product,
            'Keyword': f"{keyword} {product}",
            'Campaign': 'SEM_Sofas',
            'Criterion Type': 'Exact'
        })
        data.append({
            'Ad Group': product,
            'Keyword': f"{product} {keyword}",
            'Campaign': 'SEM_Sofas',
            'Criterion Type': 'Exact'
        })

# Create DataFrame
keywords_df = pd.DataFrame(data)

# Remove duplicates and ensure at least 60 unique keywords
keywords_df = keywords_df.drop_duplicates().reset_index(drop=True)

if len(keywords_df) < 60:
    print("Warning: Less than 60 unique keywords generated.")
else:
    # If more than 60, keep only the first 60
    keywords_df = keywords_df.head(60)

# Save to CSV
keywords_df.to_csv('keywords.csv', index=False)

print(f"Generated {len(keywords_df)} unique keywords and saved to keywords.csv")