Social Media Organic Link Tracker
import logging
import os
from gunicorn.app.base import BaseApplication
from flask_apscheduler import APScheduler
from app_init import create_initialized_flask_app
from flask import request, redirect, url_for, render_template
from utils.main_utils import refetch_all_non_click_links
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
scheduler = APScheduler()
scheduler.init_app(app)
scheduler.start()
@scheduler.task('cron', id='get_analytics_of_links', hour='0', minute='0')
def get_analytics_of_links():
with app.app_context():
refetch_all_non_click_links()
Social Media Organic Link Tracker
Created: | Last Updated:
Here's a step-by-step guide for using the Social Media Organic Link Tracker template:
Introduction
The Social Media Organic Link Tracker is a powerful tool designed to help marketers and content creators track and analyze the performance of their social media posts across various platforms. This template provides real-time insights and performance metrics to optimize brand engagement and campaign effectiveness.
Getting Started
To begin using this template, follow these steps:
-
Click the "Start with this Template" button in the Lazy Builder interface.
-
Press the "Test" button to initiate the deployment of the app and launch the Lazy CLI.
Setting Up Environment Variables
Before you can use the app, you need to set up two important environment variables:
- YOUTUBE_API_KEY: This is required for tracking YouTube video analytics.
- RAPIDAPI_KEY: This is needed for Instagram and TikTok analytics.
To set these up:
- Go to the "Env Secrets" tab in the Lazy Builder interface.
- Add the following environment variables:
- Key:
YOUTUBE_API_KEY
, Value: Your YouTube API key - Key:
RAPIDAPI_KEY
, Value: Your RapidAPI key
Getting Your YouTube API Key
- Go to the Google Developers Console.
- Create a new project or select an existing one.
- Enable the YouTube Data API v3 for your project.
- Create credentials (API key) for the YouTube Data API.
- Copy the API key and use it as the value for
YOUTUBE_API_KEY
.
Getting Your RapidAPI Key
- Sign up or log in to your RapidAPI account.
- Subscribe to the TokAPI Mobile Version and Instagram Scraper 2022 APIs.
- On either API's documentation page, find your API Key in the "Header Parameters" section.
- Copy this API Key and use it as the value for
RAPIDAPI_KEY
.
Using the App
Once you've set up the environment variables and deployed the app:
-
You'll be presented with a login/signup page. Create an account or log in if you already have one.
-
After logging in, you'll see the dashboard where you can create and manage your campaigns.
-
To create a new campaign:
- Click on "Create New Campaign"
- Enter a name for your campaign
-
Click "Create Campaign"
-
To add links to your campaign:
- Click on "Add New Link"
- Enter the original URL of your social media post
- Select the type of link (YouTube, Instagram Post, TikTok, or Click)
-
Click "Add Link"
-
To view analytics:
- Click on the analytics icon next to each link in your campaign
-
You'll see detailed analytics including views, likes, comments, and more, depending on the platform
-
To get an overview of your entire campaign:
- Click on "View Campaign Overview"
-
This will show you aggregated data across all links in your campaign
-
To export your campaign data:
- Click on "Export to CSV" to download a spreadsheet of your campaign data
Integrating the App
This app is designed to be used as a standalone tool for tracking and analyzing your social media campaigns. There's no need for additional integration with external tools. Simply use the provided interface to manage your campaigns and view your analytics.
Remember to regularly update your analytics by clicking the "Update Analytics" button next to each link to get the most up-to-date information about your social media posts' performance.