mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-13 15:09:34 +00:00
- Unfortunately the TB CLI doesn't just output the token and instead tries to copy it to the clipboard - Since we're running inside a container we can't do that, so need to just update the docs to get it from the UI
2.0 KiB
2.0 KiB
Tinybird Configuration
Note: Currently Traffic Analytics features are behind a feature flag. For now, you'll need to enable developer experiments by setting ENABLE_DEV_EXPERIMENTS=true in your .env file, and enable the Traffic Analytics feature flag under Settings > Labs > Private Features.
Steps:
- Create a Tinybird account and a Tinybird workspace at tinybird.co. You can select any cloud/region you choose.
- Run
docker compose run --rm tinybird-loginto login to your Tinybird account - Run
docker compose --profile=analytics up tinybird-sync. This will copy the Tinybird files from the Ghost container into a shared volume. The service should log "Tinybird files synced into shared volume.", then exit. - Run
docker compose --profile=analytics up tinybird-deployand wait for the service to exit successfully. This will create your Tinybird datasources, pipes and API endpoints. It may take a minute or two to complete the first time. You should see "Deployment #1 is live!" in your terminal before the service exits. - Find your workspace's events API endpoint:
docker compose run --rm tinybird-login tb --cloud info, copy the value of "api", and add it to your.envfile asTINYBIRD_API_URL. You can also find this value in your Tinybird Workspace's UI. - Using the UI link from the previous step, open your workspace and click on Tokens in the left hand menu
- Copy your Tinybird
stats_pagetoken and add it to your.envfile asTINYBIRD_STATS_TOKEN - Copy your Tinybird
trackertoken and add it to your.envfile asTINYBIRD_TRACKER_TOKEN - Run
docker compose --profile=analytics up -dto start all services in the background. You can also setCOMPOSE_PROFILES=analyticsin your.envfile to automatically include theanalyticsprofile when runningdocker composecommands. - At this point, everything should be working. You can test it's working by visiting your site's homepage, then checking the Stats page in Ghost Admin — you should see a view recorded.