Competitor Ad Targeting Analysis with User Personas

Project Overview

Led a comprehensive analysis of competitor advertising strategies across popular Austrian websites. The project involved creating simulated user personas to identify which demographic groups were being targeted by different brands, and with what intensity.

Business Context

Understanding how competitors target their advertising is crucial for optimizing marketing strategies. This project provided actionable insights into how different brands were allocating their advertising budgets across demographic segments in the Austrian market.

Technical Challenges

Challenge 1: Creating Realistic User Personas

To accurately simulate different user profiles, we needed to create personas that would convincingly represent various demographic segments.

Challenge 2: Scalable Web Scraping

We needed to collect ad data from numerous high-traffic Austrian websites without triggering anti-bot mechanisms.

Challenge 3: Identifying Targeting Patterns

Extracting meaningful patterns from the collected ad data required sophisticated data analysis techniques.

Architecture

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
flowchart TD
    A[User Personas Creation] --> B[Browser Profile Generation]
    B --> C[Automated Web Browsing]
    C --> D[Ad Collection & Storage]
    D --> E[Data Processing]
    E --> F[Pattern Analysis]
    F --> G[Visualization & Reporting]

    subgraph "Data Collection"
    B
    C
    D
    end

    subgraph "Data Analysis"
    E
    F
    end

Implementation Details

User Persona Framework

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class UserPersona:
    def __init__(self, age, gender, interests, location, income_level):
        self.age = age
        self.gender = gender
        self.interests = interests
        self.location = location
        self.income_level = income_level
        self.browsing_history = []

    def generate_browser_profile(self):
        # Create browser profile based on persona attributes
        profile = {
            "cookies": self._generate_interest_cookies(),
            "user_agent": self._select_appropriate_user_agent(),
            "browsing_patterns": self._create_browsing_patterns()
        }
        return profile

    def _generate_interest_cookies(self):
        # Generate cookies that reflect the interests of this persona
        pass

    def _select_appropriate_user_agent(self):
        # Select user agent that aligns with persona demographics
        pass

    def _create_browsing_patterns(self):
        # Create realistic browsing patterns for this persona type
        pass

Web Scraping Implementation

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
def collect_ads(persona, target_sites):
    """
    Collect ads shown to a specific persona on target websites

    Args:
        persona: UserPersona object
        target_sites: List of websites to visit

    Returns:
        List of Ad objects containing ad details
    """
    browser_profile = persona.generate_browser_profile()

    # Configure browser with profile
    browser = setup_browser_with_profile(browser_profile)

    collected_ads = []

    for site in target_sites:
        # Visit site and record ads
        browser.get(site)

        # Wait for ads to load
        time.sleep(random.uniform(5, 10))

        # Extract ad elements
        ad_elements = browser.find_elements_by_css_selector('.ad-container, [data-ad-slot]')

        for ad_element in ad_elements:
            # Extract ad details
            ad_data = extract_ad_data(ad_element)

            if ad_data:
                collected_ads.append(ad_data)

        # Add some randomized browsing behavior
        simulate_natural_browsing(browser)

    browser.quit()
    return collected_ads

Results and Impact

Key Findings

  • Identified that Competitor A was aggressively targeting women ages 25-34 with higher income
  • Discovered Competitor B focused primarily on urban areas with high disposable income
  • Found several untapped demographic segments with minimal competitor advertising

Business Impact

  • Provided actionable intelligence for marketing strategy adjustments
  • Identified underserved market segments for potential targeted campaigns
  • Validated effectiveness of current targeting strategies

Lessons Learned

Technical Insights

  • Web scraping at scale requires sophisticated rotation of IPs and user agents
  • Browser fingerprinting is increasingly used for user identification
  • Data analysis benefits from combining traditional statistical methods with machine learning approaches

Process Improvements

  • Automated persona rotation improved data collection efficiency by 40%
  • Continuous monitoring provided better insights than one-time analysis
  • Documentation of methodology was crucial for project handover

Future Enhancements

  • Implement machine learning for automated pattern recognition
  • Expand to international markets for comparative analysis
  • Add natural language processing to analyze ad content semantics

Tools and Technologies Used

  • Python: Core programming language
  • Selenium: Web automation and scraping
  • Pandas: Data manipulation and analysis
  • Matplotlib/Seaborn: Data visualization
  • BeautifulSoup: HTML parsing
  • Docker: Containerization for scalable scraping
  • PostgreSQL: Data storage