{"id":22403313,"url":"https://github.com/springload/springload-analytics","last_synced_at":"2026-03-05T22:34:13.057Z","repository":{"id":51100367,"uuid":"312465689","full_name":"springload/springload-analytics","owner":"springload","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-24T02:14:15.000Z","size":110,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-24T05:37:33.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/springload.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":"2020-11-13T03:42:28.000Z","updated_at":"2021-05-24T02:14:15.000Z","dependencies_parsed_at":"2022-09-19T04:50:41.619Z","dependency_job_id":null,"html_url":"https://github.com/springload/springload-analytics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/springload/springload-analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fspringload-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fspringload-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fspringload-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fspringload-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/springload-analytics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fspringload-analytics/sbom","scorecard":{"id":842517,"data":{"date":"2025-08-11","repo":{"name":"github.com/springload/springload-analytics","commit":"349b5d36389460c19abf740b894c1b9cc5bde33b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 2/25 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":"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":"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":"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":"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":"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 'main'"],"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"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T20:47:44.375Z","repository_id":51100367,"created_at":"2025-08-23T20:47:44.376Z","updated_at":"2025-08-23T20:47:44.376Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-05T09:16:48.073Z","updated_at":"2026-03-05T22:34:13.020Z","avatar_url":"https://github.com/springload.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Springload Analytics\n\n\u003e Event tracker inspired by springload-analytics.js.\n\nThis library rewrite the previous `springload-analytics.js` to and add integration of `Perfume.js` to track the performance metrics in browser.\n\n## Install\n\n```bash\nnpm install @springload/springload-analytics\nyarn add @springload/springload-analytics\n```\n\n## Basic setup\n\n```javascript\nimport * as SpringloadAnalytics from \"springload-analytics\";\nconst { googleAnalyticsPlugin, tecPlugin } = SpringloadAnalytics;\n\nSpringloadAnalytics.init({\n  trackerPlugins: [\n    googleAnalyticsPlugin({\n      trackingId: \"UA-12341131-6\",\n    }),\n    tecPlugin({\n      trackerUrl: \"/event\";\n      applicationVersion: \"ert7565456asd\";\n    })\n  ]\n});\n```\n\nThe built-in google analytics tracker now is replaced by manually passsing tracker plugins in to initialization function which allow users to customize their own tracker based on project requirement.\n\n## Performance metrics\n\n**Perfume.js** is a tiny, web performance monitoring library that reports field data back to your favorite analytics tool.\n`springload-analytics` sends performance metrics to Google Analytics using **perfume.js**.\n\n**Perfume.js** tracks the following performance mertrics:\n\n- First Paint (fp)\n- First Contentful Paint (fcp)\n- Largest Contentful Paint (lcp)\n- Largest Contentful Paint Final (lcpFinal)\n- First Input Delay (fid)\n- Cumulative Layout Shift (cls) 0-0.1\n- Cumulative Layout Shift Final (clsFinal)\n- Total Blocking Time (tbt)\n- Total Blocking Time 5S (tbt5S)\n- Total Blocking Time 10S (tbt10S)\n- Total Blocking Time Final (tbtFinal)\n\nPerformance tracking is enabled by passing performancePlugin instance to `trackerPlugins` is initialization funciton argument, You can specific the trackers you would like the tracking data be sent to in `sendTo` otherwise the data will be sent to all trackers.\n\n```javascript\nimport * as SpringloadAnalytics from 'springload-analytics';\nconst { performancePlugin } = SpringloadAnalytics;\n\nSpringloadAnalytics.init({\n  trackerPlugins: [\n    // ...other tracker plugins\n    performancePlugin({\n      sendTo: ['google-analytics'],\n    }),\n  ],\n});\n```\n\n## API Reference\n\n### Configuration\n\nAfter initialization with config, the core API is exposed \u0026 ready for use in the application.\n\n| Option             | Default     | Description                                                                                                                                |\n| ------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------ |\n| trackerPlugins     | `[]`        | The tracker plugins                                                                                                                        |\n| debug              | 'false'     | Whether open debug mode                                                                                                                    |\n| separator          | '\u0026#x7c;'    | The charactor used to separate the content of `data-analytics` attribute into tracking variables `category`, `event`, `label` and `value`. |\n| trackableAttribute | 'analytics' | The attribute name following `data-` attached to the trackable elements.                                                                   |\n| trackableEvent     | 'click'     | The event need to be tracked on trackable elements.                                                                                        |\n| payloadKeys        | `[]`        | The property keys array that related to the values in the same sequence in trackable attribute separated by separator.                     |\n\n```javascript\nSpringloadAnalytics.init({\n  separator: \":\"\n  trackableAttribute: \"sp-analytics\",\n  trackableEvent: \"hover\",\n  payloadKeys: [\"label\", \"data\"]\n});\n```\n\n### Page\n\nTrigger page view measurement calls in Google analytics.\n\n**Arguments:**\n\n- [data] (optional) PageData - Page data overrides.\n- [options] (optional) Object - Page tracking options\n- [callback] (optional) Function - Callback to fire after page view call completes\n\n```javascript\n// Basic page tracking\nSpringloadAnalytics.page();\n\n// Page tracking with page data overrides\nSpringloadAnalytics.page({\n  url: 'https://google.com',\n});\n\n// Fire callback with 1st, 2nd or 3rd argument\nSpringloadAnalytics.page(() =\u003e {\n  console.log('do this after page');\n});\n\n// Send pageview to only to specific analytic tools\nSpringloadAnalytics.page({}, ['google-ana']);\n```\n\n## Custom tracking\n\nCustom targeted tracking you can specify event data by populating the data-analytics attribute with pipe (|) separated values.\n\n```javascript\nSpringloadAnalytics.setupTrackables({\n  event: 'Link click',\n  payloadKeys: ['category', 'label', 'value'],\n});\n```\n\n```html\n\u003c!-- E.g. Use custom category, custom label and a custom value --\u003e\n\u003ca data-analytics=\"Top navigation|Homepage link|1\" href=\"/\"\u003eHome\u003c/a\u003e\n\n\u003c!-- E.g. Use custom label only --\u003e\n\u003ca data-analytics=\"|Homepage link\" href=\"/\"\u003eHome\u003c/a\u003e\n\n\u003c!-- E.g. Use custom value only --\u003e\n\u003ca data-analytics=\"||1\" href=\"/\"\u003eHome\u003c/a\u003e\n\n\u003c!-- E.g. Use custom category and custom label only --\u003e\n\u003ca data-analytics=\"UI Elements|Show data\" href=\"#\"\u003eShow\u003c/a\u003e\n\n\u003c!-- E.g. Use custom category and custom value only --\u003e\n\u003ca data-analytics=\"UI Elements||1\" href=\"#\"\u003eShow\u003c/a\u003e\n\n\u003c!-- E.g. Custom track a group of elements with custom category and event --\u003e\n\u003cdiv data-analytics=\"Top navigation\"\u003e\n  \u003cul\u003e\n    \u003cli\u003e\u003ca href=\"/\"\u003eHome\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"/about-us/\"\u003eAbout us\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"/contact-us/\"\u003eContact us\u003c/a\u003e\u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n```\n\n## Tracking dynamically\n\nYou can track within a JavaScript file by calling the track method, just specify the event and pass the event data which will be sent to trackers:\n\n```javascript\n// Specify event and payload.\nSpringloadAnalytics.track(event, {\n  label,\n  value,\n  category,\n});\n\n// Specify the trackers that will receive the payload, by default it'll be sent to all tracker.\nSpringloadAnalytics.track(\n  event,\n  {\n    label,\n    data,\n  },\n  ['tec']\n);\n```\n\n## Setup additional trackable elements on the fly\n\nYou can set up additional/alternative trackable elements on the fly by calling `setupTrackables`:\n\n```javascript\nSpringloadAnalytics.setupTrackables({\n  trackableAttribute: 'google-analytics',\n  trackableEvent: 'mouseenter',\n  separator: ':',\n  event: 'hover read more',\n  payloadKeys: ['page', 'section'],\n  sendTo: ['google-analytics'], // Not specific it will send to all trackers\n});\n```\n\nThe markup for this example would be:\n\n```html\n\u003cdiv data-google-analytics=\"home:header\"\u003e\n  \u003cspan\u003eRead more\u003c/span\u003e\n\u003c/div\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fspringload-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Fspringload-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fspringload-analytics/lists"}