Workflow

TikTok Hashtag Campaign Tracker Workflow

Workflow that tracks TikTok hashtag campaign performance daily by monitoring post volume, engagement trends, and top-performing content for branded hashtags.

Overview

Brands launch TikTok hashtag campaigns and then have no way to track performance beyond the app's basic analytics. This workflow monitors your branded hashtags daily: count new posts, track total engagement (likes, comments, shares), identify top-performing content, and detect when engagement is declining so you can boost or pivot. All data is structured and exportable.

Trigger

Daily at 10 AM during active campaigns.

Schedule

Daily 10 AM

Workflow Steps

1

Define Campaign Hashtags

List the branded hashtags to track. Include the primary campaign tag and any variations.

2

Search TikTok for Hashtag Content

Call Scavio TikTok search for each hashtag. Collect posts, view counts, and engagement metrics.

3

Calculate Daily Metrics

Count new posts since last check. Sum total views, likes, and comments across all posts.

4

Identify Top Performers

Rank posts by engagement rate. Surface the top 5 posts for the marketing team to amplify.

5

Detect Trend Direction

Compare today's metrics against the 7-day average. Flag declining engagement for intervention.

Python Implementation

Python
import requests, os, json
from pathlib import Path
from datetime import date

API_KEY = os.environ["SCAVIO_API_KEY"]
TH = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}

HASHTAGS = ["#YourBrandChallenge", "#YourBrandLaunch"]
HISTORY_FILE = Path("hashtag_campaign.json")

def search_hashtag(hashtag: str) -> list:
    resp = requests.post(
        "https://api.scavio.dev/api/v1/tiktok/search",
        headers=TH,
        json={"query": hashtag},
        timeout=15,
    )
    return resp.json().get("results", [])

def track_campaign():
    history = json.loads(HISTORY_FILE.read_text()) if HISTORY_FILE.exists() else {"days": []}
    today_data = {"date": str(date.today()), "hashtags": {}}

    for tag in HASHTAGS:
        posts = search_hashtag(tag)
        total_views = sum(p.get("views", 0) for p in posts)
        total_likes = sum(p.get("likes", 0) for p in posts)
        total_comments = sum(p.get("comments", 0) for p in posts)
        top_posts = sorted(posts, key=lambda p: p.get("likes", 0), reverse=True)[:5]

        today_data["hashtags"][tag] = {
            "post_count": len(posts),
            "total_views": total_views,
            "total_likes": total_likes,
            "total_comments": total_comments,
            "top_posts": [{"url": p.get("url", ""), "likes": p.get("likes", 0), "views": p.get("views", 0)} for p in top_posts],
        }

    # Detect trend
    recent_days = history["days"][-7:]
    for tag in HASHTAGS:
        if recent_days:
            avg_likes = sum(d["hashtags"].get(tag, {}).get("total_likes", 0) for d in recent_days) / len(recent_days)
            current = today_data["hashtags"][tag]["total_likes"]
            trend = "UP" if current > avg_likes * 1.1 else "DOWN" if current < avg_likes * 0.9 else "STABLE"
            today_data["hashtags"][tag]["trend"] = trend

    history["days"].append(today_data)
    HISTORY_FILE.write_text(json.dumps(history, indent=2))
    return today_data

report = track_campaign()
for tag, data in report["hashtags"].items():
    print(f"{tag}: {data['post_count']} posts, {data['total_views']} views, {data['total_likes']} likes, trend={data.get('trend', 'N/A')}")

JavaScript Implementation

JavaScript
const TH = {'Authorization': 'Bearer '+process.env.SCAVIO_API_KEY, 'Content-Type': 'application/json'};
const fs = await import('fs');

const HASHTAGS = ['#YourBrandChallenge', '#YourBrandLaunch'];
const HISTORY_FILE = 'hashtag_campaign.json';

async function searchHashtag(hashtag) {
  const r = await fetch('https://api.scavio.dev/api/v1/tiktok/search', {method:'POST', headers:TH, body:JSON.stringify({query:hashtag})});
  return (await r.json()).results || [];
}

async function trackCampaign() {
  let history = {days:[]};
  try { history = JSON.parse(fs.readFileSync(HISTORY_FILE, 'utf8')); } catch {}
  const todayData = {date:new Date().toISOString().split('T')[0], hashtags:{}};
  for (const tag of HASHTAGS) {
    const posts = await searchHashtag(tag);
    const totalViews = posts.reduce((s,p)=>s+(p.views||0),0);
    const totalLikes = posts.reduce((s,p)=>s+(p.likes||0),0);
    const totalComments = posts.reduce((s,p)=>s+(p.comments||0),0);
    const topPosts = [...posts].sort((a,b)=>(b.likes||0)-(a.likes||0)).slice(0,5).map(p=>({url:p.url||'', likes:p.likes||0, views:p.views||0}));
    todayData.hashtags[tag] = {postCount:posts.length, totalViews, totalLikes, totalComments, topPosts};
    const recentDays = history.days.slice(-7);
    if (recentDays.length) {
      const avgLikes = recentDays.reduce((s,d)=>s+((d.hashtags[tag]||{}).totalLikes||0),0)/recentDays.length;
      todayData.hashtags[tag].trend = totalLikes>avgLikes*1.1?'UP':totalLikes<avgLikes*0.9?'DOWN':'STABLE';
    }
  }
  history.days.push(todayData);
  fs.writeFileSync(HISTORY_FILE, JSON.stringify(history, null, 2));
  return todayData;
}

const report = await trackCampaign();
for (const [tag, data] of Object.entries(report.hashtags)) {
  console.log(tag+': '+data.postCount+' posts, '+data.totalViews+' views, '+data.totalLikes+' likes, trend='+(data.trend||'N/A'));
}

Platforms Used

TikTok

Trending video, creator, and product discovery

Frequently Asked Questions

Brands launch TikTok hashtag campaigns and then have no way to track performance beyond the app's basic analytics. This workflow monitors your branded hashtags daily: count new posts, track total engagement (likes, comments, shares), identify top-performing content, and detect when engagement is declining so you can boost or pivot. All data is structured and exportable.

This workflow uses a daily at 10 am during active campaigns.. Daily 10 AM.

This workflow uses the following Scavio platforms: tiktok. Each platform is called via the same unified API endpoint.

Yes. Scavio's free tier includes 250 credits per month with no credit card required. That is enough to test and validate this workflow before scaling it.

TikTok Hashtag Campaign Tracker Workflow

Workflow that tracks TikTok hashtag campaign performance daily by monitoring post volume, engagement trends, and top-performing content for branded hashtags.