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

# Track analytics with the Content Tag API

> Group posts by campaign, product, or theme using content tags and track performance across brands.

Use the Content Tag API to group posts by campaign, product, or theme across multiple brands—then track performance by tag.

## Use case

You're launching a lipstick campaign across four brands. Create a "Lipstick" tag, apply it via automation, and report on engagement across all related posts.

## Implementation

### Before you start

You'll need:

* API Key
* Brand IDs
* Organization ID

If you don't have your organization ID, call `GET https://auth.dashsocial.com/api/self` using your API key:

```bash theme={null}
curl 'https://auth.dashsocial.com/api/self' \
  -H 'Authorization: Bearer {token}'
```

Sample response:

```json theme={null}
{
    "accessible_brands": [144],
    "brands": {
        "your-brand": {
            "id": 144,
            "name": "Your Brand",
            "organization": {
                "id": 1,
                "name": "Your Organization"
            },
            "organization_id": 1
        }
    },
    "organization": {
        "id": 1,
        "name": "Your Organization"
    },
    "organization_id": 1
}
```

Look for `organization_id` at the top level of the response.

[Get started with the API →](https://developer.dashsocial.com/guides/get-started/quickstart)

### Step 1: Creating a content tag

<Info>
  **Already have a Content Tag?** Skip this step and jump to Step 2.
</Info>

Start by creating a tag to group your campaign content. This lets you later filter and report on posts that share the same theme, product, or time frame.

```http theme={null}
POST https://library-backend.dashsocial.com/organizations/{organization_id}/content_tags
body = {
    "name": "Lipstick",
    "brand_ids": [
        1000,
        1001,
        1002,
        1003
    ]
}
```

#### Key query parameters

* `organization_id`: Your org's unique ID (ask your account manager if unsure)
* `name`: Name of the tag (e.g., "Lipstick")
* `brand_ids`: Array of brand IDs to apply this tag to

Sample response:

```json theme={null}
{
    "brand_ids": [
        1000,
        1001,
        1002,
        1003
    ],
    "created_at": "2025-03-07T15:48:45+00:00",
    "id": 3817,
    "name": "Lipstick",
    "organization_id": 1,
    "updated_at": "2025-03-07T15:48:45+00:00"
}
```

### Step 2: Retrieving content tags

Use this endpoint to list all your content tags. Useful for confirming tag names or getting tag IDs for reporting:

```http theme={null}
GET https://library-backend.dashsocial.com/organizations/{organization_id}/content_tags
```

#### Key query parameters

* `organization_id`: Your organization's unique ID.

Sample response:

```json theme={null}
[
    {
        "brand_ids": [
       	 		1000,
        		1001,
        		1002,
        		1003
    		],
        "created_at": "2025-01-26T08:20:44+00:00",
        "id": 3816,
        "name": "2025",
        "organization_id": 1,
        "updated_at": "2025-01-26T08:20:44+00:00"
    }
    {
        "brand_ids": [
       	 		1000,
        		1001,
        		1002,
        		1003
    		],
        "created_at": "2025-03-07T15:48:45+00:00",
        "id": 3817,
        "name": "Lipstick",
        "organization_id": 1,
        "updated_at": "2025-03-07T15:48:45+00:00"
    }
 ]
```

### Step 3: Auto-tag posts

Use [Content Automation](https://help.dashsocial.com/hc/en-us/articles/31114279045389-How-to-Set-Up-and-Manage-Content-Automation) to apply tags based on rules (e.g., hashtags, captions).

### Step 4: Get post level metrics

Use this query to get a list of posts that have specific tags, along with metrics like impressions, likes, or comments. Ideal for reviewing individual post performance:

```http theme={null}
PUT https://library-backend.dashsocial.com/brands/{brand_id}/media/v2
body = {
    "filters": {
        "content_tags": ["Lipstick", "2025"]
    },
    "limit": 99,
    "offset":0
}
```

#### Key query parameters

* `brand_id`: Brand ID you're querying
* `content_tags`: Tags to filter by (e.g., `["Lipstick", "2025"]`)
* `limit`: Max results per page (default 99)
* `offset`: Pagination offset.

Sample response:

```json theme={null}
{
    "data": [
        {
            "brand_id": 1000,
            "brand_media_id": 796350589,
            "caption_question": {
                "is_question": false,
                "user_overridden": false
            },
            "caption_sentiment": {
                "is_negative": false,
                "is_neutral": true,
                "is_positive": false,
                "user_overridden": false
            },
            "comment_sentiment": null,
            "community_engagement": null,
            "content_tags": [
                "A test content tag"
            ],
            "created_at": "2025-02-27T17:16:56",
            "custom_metrics": [
                {
                    "id": 78,
                    "value": null
                }
            ],
            "facebook": null,
            "id": 506593868,
            "image": {
                "sizes": {
                    "medium_square": {
                        "height": 640,
                        "url": "https://images.dashsocial.com/aHR0cHM6Ly9jZG4uZGFzaHNvY2lhbC5jb20vbWVkaWEvZnVsbC8xNzQwNjc2NjE0LjgzODM2MTU5MTE5MC5qcGVn.jpg?w=640&h=640&fit=cover",
                        "width": 640
                    },
                    "original": {
                        "height": 1024,
                        "size": 213914,
                        "url": "https://cdn.dashsocial.com/media/original/1740676614.732703492652.jpg",
                        "width": 1024
                    },
                    "original_converted": {
                        "height": 1024,
                        "size": 209493,
                        "url": "https://cdn.dashsocial.com/media/full/1740676614.838361591190.jpeg",
                        "width": 1024
                    },
                    "small": {
                        "height": 400,
                        "url": "https://images.dashsocial.com/aHR0cHM6Ly9jZG4uZGFzaHNvY2lhbC5jb20vbWVkaWEvZnVsbC8xNzQwNjc2NjE0LjgzODM2MTU5MTE5MC5qcGVn.jpg?w=400&h=400",
                        "width": 400
                    },
                    "small_square": {
                        "height": 400,
                        "url": "https://images.dashsocial.com/aHR0cHM6Ly9jZG4uZGFzaHNvY2lhbC5jb20vbWVkaWEvZnVsbC8xNzQwNjc2NjE0LjgzODM2MTU5MTE5MC5qcGVn.jpg?w=400&h=400&fit=cover",
                        "width": 400
                    }
                }
            },
            "instagram": {
                "ad_ids": null,
                "adset_ids": null,
                "amount_spent": null,
                "avg_time_viewed_sec": null,
                "campaign_ids": null,
                "caption": "",
                "clicks": null,
                "comments_count": 0,
                "cost_per_thruplay": null,
                "cpc": null,
                "cpm": null,
                "ctr": null,
                "effectiveness": 0.0,
                "emv": 300.32,
                "engagement": 0.0,
                "engagement_rate_impressions": 0.0,
                "engagement_rate_public": 0.0,
                "entertainment_score": null,
                "followers_gained": null,
                "follows": null,
                "hashtags": [],
                "impressions": 0,
                "is_boosted": false,
                "is_carousel": true,
                "is_commented": false,
                "is_mentioned": false,
                "is_riq": false,
                "is_tagged": false,
                "like_count": 0,
                "paid_and_organic_reach": 0,
                "paid_and_organic_saved": 0,
                "paid_and_organic_shares": 0,
                "paid_comments": 0,
                "paid_engagement_rate": 0.0,
                "paid_impressions": 0,
                "paid_likes": 0,
                "paid_reach": null,
                "paid_reactions": null,
                "paid_saved": 0,
                "paid_shares": null,
                "paid_total_engagement": 0,
                "paid_total_engagements": 0,
                "paid_video_views": null,
                "photo_tags": [],
                "post_type": "carousel",
                "profile_activity": {
                    "bio_link_clicked": 0,
                    "direction": 0,
                    "email": 0,
                    "other": 0,
                    "text": 0,
                    "total": 0
                },
                "profile_visits": null,
                "reach": 0,
                "replays": null,
                "saved": 0,
                "shares": 0,
                "sum_total_engagement": 0,
                "sum_total_engagements": 0,
                "thruplays": null,
                "timestamp": "2025-02-27T17:15:54+00:00",
                "total_comments": 0,
                "total_engagement": 0,
                "total_impressions": 0,
                "total_likes": 0,
                "total_plays": null,
                "total_time_viewed_sec": null,
                "total_video_views": null,
                "url": "https://www.instagram.com/p/DGlV4j3z_K7/",
                "video_plays_100": null,
                "video_plays_25": null,
                "video_plays_50": null,
                "video_plays_75": null,
                "video_views": null,
                "views": 1
            },
            "instagram_ads": null,
            "instagram_story_frame": null,
            "likeshop": {
                "clicks": 0,
                "links": null,
                "tiktok_clicks": null
            },
            "linkedin": null,
            "meta": {},
            "pinterest": null,
            "predictions": {
                "engagement": 0.0272196
            },
            "source": "INSTAGRAM",
            "source_created_at": "2025-02-27T17:15:54",
            "source_id": "17875851276184969",
            "source_type": "OWNED",
            "threads": null,
            "tiktok": null,
            "twitter": null,
            "type": "CAROUSEL",
            "youtube": null
        }
    ],
    "paging": {
        "count": 1,
        "next": null,
        "previous": null
    }
}
```

### Step 5: Get aggregated metrics

Use this endpoint to pull total engagement data for all posts with a given tag—across brands and platforms. Great for high-level campaign reporting.

```http theme={null}
GET
https://dashboard.dashsocial.com/reports/data?
		brand_ids=1000,1001,1002
    &start_date=2025-01-01
    &end_date=2025-03-07
    &context_start_date=2025-01-01
    &context_end_date=2025-03-07
    &channels=FACEBOOK
    &metrics=TOTAL_ENGAGEMENTS
    &content_tag_ids=3817,3818
```

### Key query parameters

* `brand_ids`: Comma-separated brand IDs (e.g., 1000,1001)
* `start_date`,`end_date`: Reporting period.
* `context_start_date`,`context_end_date`: Comparison period (optional)
* `channels`: Social media channel (e.g., "FACEBOOK")
* `metrics`: Metric types (e.g., TOTAL\_ENGAGEMENTS)
* `content_tag_ids`: Filter by tag IDs. This can be retrieved from [Step 2: Retrieving all content tags](#step-2-retrieving-content-tags)
