{"id":13632858,"url":"https://github.com/tinybirdco/web-analytics-starter-kit","last_synced_at":"2025-05-15T02:07:53.044Z","repository":{"id":60286075,"uuid":"531893014","full_name":"tinybirdco/web-analytics-starter-kit","owner":"tinybirdco","description":"Tinybird Web Analytics template","archived":false,"fork":false,"pushed_at":"2025-04-12T04:53:15.000Z","size":3022,"stargazers_count":376,"open_issues_count":7,"forks_count":37,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-13T23:54:27.222Z","etag":null,"topics":["analytics","data","real-time","realtime","starter-kit","tinybird","tracker","tracking","web-analytics","webanalytics"],"latest_commit_sha":null,"homepage":"https://tinybird.co/starter-kits/web-analytics","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinybirdco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-02T11:11:18.000Z","updated_at":"2025-04-13T15:15:06.000Z","dependencies_parsed_at":"2024-04-22T17:30:23.621Z","dependency_job_id":"939c0edf-8a42-4fef-8a11-e9be779b32af","html_url":"https://github.com/tinybirdco/web-analytics-starter-kit","commit_stats":{"total_commits":56,"total_committers":10,"mean_commits":5.6,"dds":0.5,"last_synced_commit":"ea274a27c490fe40f531c705539e31b7d65e9976"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fweb-analytics-starter-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fweb-analytics-starter-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fweb-analytics-starter-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fweb-analytics-starter-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/web-analytics-starter-kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259383,"owners_count":22040820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","data","real-time","realtime","starter-kit","tinybird","tracker","tracking","web-analytics","webanalytics"],"created_at":"2024-08-01T22:03:19.925Z","updated_at":"2025-05-15T02:07:48.034Z","avatar_url":"https://github.com/tinybirdco.png","language":"TypeScript","readme":"# Web Analytics template for Tinybird\n\nBuild your own web analytics platform using [Tinybird](https://www.tinybird.co/)'s Events API and Endpoints. Built with privacy and speed as top priorities, this template lets you get real-time metrics in a pre-built dashboard in just a few minutes without any knowledge about Tinybird. Our [free accounts](https://www.tinybird.co/pricing) serve up to 1000 requests per day and unlimited processed GB, more than enough to get started.\n\nAfter you've finished the basic setup, expand your analytics with custom events tailored to your specific use cases (eCommerce, marketing, etc.), keeping the same real-time performance.\n\n![Tinybird Web Analytics Dashboard](./assets/img/repo-banner.png)\n\n## Get started\n\n### Set up the data project\n\nTo deploy this template on Tinybird:\n\n```bash\ncurl -sSL https://tinybird.co | bash\ntb login\ntb --cloud deploy --template https://github.com/tinybirdco/web-analytics-starter-kit/tree/main/tinybird\n```\n\nFollow the guided process, and your Tinybird workspace is now ready to start receiving events. All your Data Sources, [Materialized Views](https://www.tinybird.co/guide/materialized-views), and API Endpoints should be installed and ready. If you go to the **Data Flow** tab, you should see something like this:\n\n![Data flow](./assets/img/data_flow.png)\n\n### Send events to your data source\n\nCopy the snippet from the banner and paste it within your site `\u003chead\u003e` section:\n\n![Banner showed to copy HTML snippet](./assets/img/banner_snippet.png)\n\nThe snippet looks like this:\n\n```html\n\u003cscript\n  defer\n  src=\"https://unpkg.com/@tinybirdco/flock.js\"\n  data-token=\"YOUR_TRACKER_TOKEN\"\n\u003e\u003c/script\u003e\n```\n\nIf everything is working correctly, you should start seeing rows in your Data Source as visitors view and interact with your website:\n\n![Incoming events](./assets/img/events-incoming.svg)\n\n### Visualize the metrics on a readymade dashboard\n\nNow you'll see a banner with a link to the dashboard. Click to open it:\n\n![Analytics dashboard preview](./assets/img/banner_dashboard.png)\n\nAlternatively, you can always navigate to https://analytics.tinybird.co/ and paste your `dashboard` token.\n\nYou'll find this `dashboard` token already created for you on the Tinybird UI, under **Manage Auth Tokens**.\n\n## Advanced\n\n### Local development and mock data\n\nSee the [tinybird](./tinybird/README.md) and [dashboard](./dashboard/README.md) READMEs.\n\n### CLI installation of the Tinybird project\n\n1. Install the Tinybird CLI using `curl https://tinybird.co | bash`\n2. Create a [Tinybird](https://tinybird.co) account and a workspace by running `tb login`\n3. Clone this repository:\n\n```bash\ngit clone https://github.com/tinybirdco/web-analytics-starter-kit\ncd web-analytics-starter-kit\ncd tinybird\n```\n\n4. Deploy the project using `tb --cloud deploy`.\n\n### Hosting your own dashboard on Vercel\n\nIf you want to customize \u0026 host your own dashboard, you can easily deploy the project to Vercel using the button below:\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Ftinybirdco%2Fweb-analytics-starter-kit\u0026project-name=tinybird-web-analytics-starter-kit\u0026repository-name=tinybird-web-analytics-starter-kit\u0026demo-title=Tinybird%20Web%20Analytics\u0026demo-description=A%20privacy-first%20Web%20Analytics%20project%20built%20with%20Tinybird\u0026demo-url=https%3A%2F%2Fanalytics.tinybird.co%2F\u0026demo-image=//github.com/tinybirdco/web-analytics-starter-kit/blob/main/dashboard/public/banner.png?raw=true\u0026root-directory=dashboard\u0026integration-ids=oac_uoH2YyxhaS1H6UYvtuRbRbDY)\n\n\n### Additional script parameters\n\nThese parameters can be used with the example tracker snippet:\n\n| Parameter         | Mandatory | Description                                                                                                                                                                                       |\n| ----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `data-token`      | Yes       | Your `tracker` token. It's already created for you, you can find it on the Tinybird UI under \"Manage Auth Tokens\"                                                                                 |\n| `data-proxy`      | No        | Your domain URL to proxy the request, if you follow the optional steps for \"GDPR Best Practices\"                                                                                                  |\n| `data-host`       | No        | Tinybird host URL. Ddefaults to `https://api.tinybird.co/`, but could be `https://api.us-east.tinybird.co` or a dedicated cluster. The banner already generates the snippet with the proper host. |\n| `data-datasource` | No        | If you iterate the landing data source, or you just want to ingest the event in a different one, you can specify the landing data source name. \n\n### Implementing custom events\n\nThe script also provides you with a function to send custom events. You can simply add this to your application at any point:\n\n```js\nTinybird.trackEvent('add_to_cart', {\n  partnumber: 'A1708 (EMC 3164)',\n  quantity: 1,\n})\n```\n\nYou can also fork the dashboard project in this repository and create custom components for your new events. It's a Next.js project, so you can deploy it easily on [Vercel](https://vercel.com/).\n\n### Implementing custom attributes\n\nYou can include custom attributes in the import library snippet. Attributes name must have **tb\\_** prefix. Every attribute included with this requirement would be saved in the payload column of your analytics_events datasource and will be included in every event. For example:\n\n```js\n\u003cscript\n  src=\"https://unpkg.com/@tinybirdco/flock.js\"\n  data-token=\"TOKEN-ID\"\n  tb_customer_id=\"CUSTOMER_ID\"\n\u003e\u003c/script\u003e\n```\n\nWould append customer_id:CUSTOMER_ID to the rest of variables saved in payload column.\n\n## GDPR\n\nTinybird is GDPR compliant as a platform, but it is your responsibility to follow GDPR's rules on data collection and consent when implementing your web analytics.\n\n---\n\nNeed help?: [Community Slack](https://www.tinybird.co/join-our-slack-community) \u0026bull; [Tinybird Docs](https://docs.tinybird.co/)\n","funding_links":[],"categories":["TypeScript","Starter Kits 🛠️"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fweb-analytics-starter-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fweb-analytics-starter-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fweb-analytics-starter-kit/lists"}