{"id":33314043,"url":"https://github.com/thebarty/gatsby-plugin-analytics-without-segment","last_synced_at":"2026-06-19T09:32:09.531Z","repository":{"id":57244582,"uuid":"154475686","full_name":"thebarty/gatsby-plugin-analytics-without-segment","owner":"thebarty","description":"A Gatsby plugin to use Segments open-source analytics library (analytics.js) WITHOUT using the paid Segment service (segment.com).","archived":false,"fork":false,"pushed_at":"2018-10-25T15:22:09.000Z","size":66,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T04:43:01.152Z","etag":null,"topics":["analytics","analytics-tracking","analyticsjs","free","segment","standalone","without"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thebarty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-24T09:37:24.000Z","updated_at":"2020-09-07T17:31:22.000Z","dependencies_parsed_at":"2022-09-01T04:20:11.794Z","dependency_job_id":null,"html_url":"https://github.com/thebarty/gatsby-plugin-analytics-without-segment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thebarty/gatsby-plugin-analytics-without-segment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarty%2Fgatsby-plugin-analytics-without-segment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarty%2Fgatsby-plugin-analytics-without-segment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarty%2Fgatsby-plugin-analytics-without-segment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarty%2Fgatsby-plugin-analytics-without-segment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thebarty","download_url":"https://codeload.github.com/thebarty/gatsby-plugin-analytics-without-segment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thebarty%2Fgatsby-plugin-analytics-without-segment/sbom","scorecard":{"id":877931,"data":{"date":"2025-08-11","repo":{"name":"github.com/thebarty/gatsby-plugin-analytics-without-segment","commit":"25b93938ba44e22382165d7f6fd0a24327b1760e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T06:47:34.555Z","repository_id":57244582,"created_at":"2025-08-24T06:47:34.555Z","updated_at":"2025-08-24T06:47:34.555Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34526065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","analytics-tracking","analyticsjs","free","segment","standalone","without"],"created_at":"2025-11-19T11:00:53.001Z","updated_at":"2026-06-19T09:32:09.517Z","avatar_url":"https://github.com/thebarty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Use analytics.js without Segment in Gatsby (gatsby-plugin-analytics-without-segment)\n\nA [Gatsby](https://www.gatsbyjs.org) plugin to use Segments open-source analytics library (analytics.js) **WITHOUT using the paid Segment service (segment.com)**.\n\n## Why this package?\nThe concept of analytics.js is awesome. **BUT Segments's  free tier (max 1.000 monthly users) might not work for you**, if you have a lot of non-paying visitors on your website.\n\nSo if you want an **easy-to-configure** `analytics.js`-wrapper for your analytics (**Google Analytics, Mixpanel, Hotjar, YouNameIt, ...**), then this is your go-to! Basically **ALL big analytics-integrations are supported**.\n\n**This solution is open source, unlimited and free forever!**\n\n*Background (state 2018-10-24): Segment.com has aggressive pay-or-leave policies, which they will apply after you hit the 1000 free monthly users limit. They will lock your account and stop processing your events after a deadline.*\n\n## Features\n\n * **Best-practise loading of analytics.js**: This plugin loads [Segments analytics.js](https://github.com/segmentio/analytics.js) following [best-practises](http://www.ianww.com/blog/2017/08/06/analytics-js-standalone-library/) and enables you to easily set options (`cdnUrl` and `services`) via Gatsby-config.\n * **Unlimited and free**: You'll use the free analytics.js and not depend on Segment (which has aggressive pay-or-leave policies, after you hit the 1000 free monthly users)\n * **Auto-Track route changes**: Routes are **automatically** tracked via `analytics.page()` via Gatsby\n * **Track events anywhere**: You can track custom-events anywhere in your code via `analytics.track()`\n * **Supported integrations**: A LOT of analytics-tools are supported. see https://github.com/segment-integrations.\n * **Development-mode**: In development you'll only see the events in the console. Your events will NOT be forwarded\n * **Production-mode**: All events will be routed to the services. Check your console for possible errors.\n\n## INSTALL\n\nInstall via npm\n\n```\nnpm install gatsby-plugin-analytics-without-segment --save\n```\n\n## Usage\n\nIn your `gatsby-config.js`, add:\n\n```js\nmodule.exports = {\n  plugins: [\n    // your other plugins...\n    {\n      resolve: 'gatsby-plugin-analytics-without-segment',\n      options: {\n        cdnUrl: 'https://cdnjs.cloudflare.com/ajax/libs/analytics.js/2.9.1/analytics.min.js',  // host yourself or use cdnjs (https://cdnjs.com/libraries/analytics.js)\n        services: {\n          // see integration https://github.com/segment-integrations/analytics.js-integration-google-analytics/blob/master/lib/index.js\n          'Google Analytics': {\n            trackingId: 'UA-XXX-1',\n            anonymizeIp: true,\n          },\n          // see integration https://github.com/segment-integrations/analytics.js-integration-mixpanel/blob/master/lib/index.js\n          'Mixpanel': {\n            token: 'XXX',\n            people: true,\n            trackAllPages: true,\n          },\n          // see integration https://github.com/segment-integrations/analytics.js-integration-fullstory/blob/master/lib/index.js\n          'FullStory': {\n            org: 'XXX',\n            debug: true,\n          },\n          // ... other service? See supported integrations (that can be loaded via analytics.js) at https://github.com/segment-integrations.\n        },\n      },\n    },\n    // ...your other plugins\n  ]\n}\n```\n\nIn your code you can track events like:\n\n```\nanalytics.track('Some event', {\n  property1: 'xyz',\n  // more data\n})\n```\n\n## WHY using this?\n\nAdvantages:\n * You will NOT run out of segments free tier after hitting 1000 MPU (monthly users), because you simply do NOT use it\n * You'll have a single API for tracking analytics (p.e. `analytics.page()` or `analytics.track()`)\n\nDisadvantages:\n * This does NOT work on server-side\n * It might take a bit more time to configure than using segment\n * You do NOT any of segments other cool features (which you will not need when starting a side-project)\n\n## Question: What analytics-services are supported?\nYou should be able to use ALL services that segment itself supports and has integrations available. You'll have to dig around a bit in segment's code to find the options for each individual tool.\n\nCheck out the supported Integrations (that can be loaded via analytics.js) at https://github.com/segment-integrations.\n\n## Credits\n\nThis is project is based on https://gist.github.com/typpo/5e2e4403c60314e04e8b6b257555f6de\n and the related blogpost at http://www.ianww.com/blog/2017/08/06/analytics-js-standalone-library/.\n\n## Contribute (Development notes)\n\nCopy this to your local `/plugins/gatsby-plugin-analytics-without-segment`-directory.\nGatsby will prioritise local over remove.\n\nOn the command-line, start a second terminal, go to `/plugins/gatsby-plugin-analytics-without-segment`\nand run `npm run build-watch` to auto-compile on file-change from /src to / via babel.\n\nCLI cheatsheat:\n\n```\nnpm run build-watch;  # auto-compile on file-change from /src to / via babel\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebarty%2Fgatsby-plugin-analytics-without-segment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthebarty%2Fgatsby-plugin-analytics-without-segment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthebarty%2Fgatsby-plugin-analytics-without-segment/lists"}