> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tapti.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Audience Demographics

> Learn how to implement AI chatbots that can analyze audience demographics and provide strategic insights using the MCP server.

# Audience Demographic Analysis

This example demonstrates a simple workflow to retrieve and analyze audience demographics across social media platforms using the MCP server.

## Basic Workflow

<CodeGroup>
  ```text Simple Example theme={null}
  User: List all my users

  AI: [Calls get-users-by-tenant-app]
  Here are all your users:

  1. John Smith (john.smith@example.com)
     - ID: user-123-abc-456-def
     - Created: January 15, 2025

  2. Sarah Johnson (sarah.j@example.com)
     - ID: user-789-ghi-101-jkl
     - Created: February 3, 2025

  User: List all user accounts Sarah Johnson has

  AI: [Calls get-user-accounts with user_id]
  Sarah Johnson (sarah.j@example.com) has the following user accounts:

  1. Instagram
     - ID: acct-456-insta-789
     - Platform Account ID: 123456789012345
     - Last refreshed: May 10, 2025
     - Status: Active

  2. LinkedIn
     - ID: acct-789-lnkd-012
     - Platform Account ID: LinkedIn123
     - Last refreshed: May 9, 2025
     - Status: Active

  User: Get the demographics for Sarah's Instagram account

  AI: [Calls get-account-demographics with user_account_id]
  Here are the demographics for Sarah's Instagram account:

  Gender Distribution:
  - Female: 63%
  - Male: 37%

  Age Breakdown:
  - 18-24 years: 20%
  - 25-34 years: 42% (largest age group)
  - 35-44 years: 25%
  - 45-54 years: 10%
  - 55+ years: 3%

  Geographic Distribution:
  - United States: 55%
  - United Kingdom: 15%
  - Canada: 10%
  - Australia: 8%
  - Other countries: 12%

  User: Compare the demographics between Instagram and LinkedIn

  AI: [Calls get-account-demographics for both accounts]
  Here's a comparison of demographics between Sarah's Instagram and LinkedIn accounts:

  Instagram:
  - Gender: 63% Female, 37% Male
  - Primary Age Group: 25-34 (42%)
  - Top Location: United States (55%)

  LinkedIn:
  - Gender: 54% Female, 46% Male
  - Primary Age Group: 35-44 (38%)
  - Top Location: United States (62%)

  Key Differences:
  - LinkedIn audience is more balanced in gender distribution
  - LinkedIn audience is generally older (38% in 35-44 age range)
  - LinkedIn has a higher concentration of US-based followers
  - Instagram has more international diversity in audience
  ```
</CodeGroup>

## Implementation Steps

To implement demographic analysis functionality, follow these simple steps:

1. **Get Users**: Use `get-users-by-tenant-app` to retrieve all users

2. **Get User Accounts**: Use `get-user-accounts` with the selected user's ID to retrieve their connected social media accounts

3. **Get Demographics**: Use `get-account-demographics` with the account ID to retrieve demographic data

4. **Get Age Breakdown**: Use `get-audience-age-breakdown` with the account ID for detailed age distribution

5. **Present Analysis**: Display the demographic data in a clear, organized format

## Audience Demographic Data Types

When analyzing audience demographics, you can access these data types:

| Data Type      | Description                            | Available Breakdowns            |
| -------------- | -------------------------------------- | ------------------------------- |
| Gender         | Gender distribution of audience        | Male, Female                    |
| Age            | Age breakdown of audience              | 18-24, 25-34, 35-44, 45-54, 55+ |
| Location       | Geographic distribution                | Countries, sometimes cities     |
| Interests      | Interest categories (when available)   | Varies by platform              |
| Activity Times | Peak engagement times (when available) | Time of day, day of week        |

## Required MCP Tools

This implementation uses these tools:

* `get-users-by-tenant-app` - Lists all users
* `get-user-accounts` - Lists user's social media accounts
* `get-account-demographics` - Gets gender and location distribution
* `get-audience-age-breakdown` - Gets detailed age demographic data

## Advanced Analysis Techniques

Here are some ways to derive deeper insights from demographic data:

1. **Cross-Platform Comparison**: Compare demographics across different platforms to identify platform-specific strategies

2. **Content Performance by Demographic**: Analyze which content performs best with specific demographic segments

3. **Demographic Trend Analysis**: Track changes in demographics over time to identify growing audience segments

4. **Audience-Content Alignment**: Ensure content strategy aligns with the preferences of key demographic groups

5. **Competitive Benchmarking**: Compare your audience demographics to industry standards or competitors

## Prompt Engineering Tips

When designing prompts for your AI assistant to handle demographic analysis, consider:

1. **Data visualization descriptions** - Describe charts or graphs in text to make the data more understandable
2. **Comparative analysis** - Enable comparisons between platforms, time periods, or industry benchmarks
3. **Actionable insights** - Don't just present data; explain what it means and how to use it
4. **Personalization level** - Allow users to request different levels of detail or focus areas
5. **Market-specific context** - Consider regional or cultural context when interpreting demographic data
