{"id":18750689,"url":"https://github.com/webiny/insight","last_synced_at":"2025-08-19T04:38:38.454Z","repository":{"id":62547881,"uuid":"84248862","full_name":"webiny/Insight","owner":"webiny","description":"App for tracking and scoring user activities. Helps you identify your power users.","archived":false,"fork":false,"pushed_at":"2017-09-29T07:20:48.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-28T22:54:00.915Z","etag":null,"topics":["activity","tracker","tracking","webiny"],"latest_commit_sha":null,"homepage":"http://www.webiny.com/","language":"JavaScript","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/webiny.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-07T21:40:38.000Z","updated_at":"2023-05-21T17:38:24.000Z","dependencies_parsed_at":"2022-11-02T22:30:35.014Z","dependency_job_id":null,"html_url":"https://github.com/webiny/Insight","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2FInsight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2FInsight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2FInsight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webiny%2FInsight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webiny","download_url":"https://codeload.github.com/webiny/Insight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239636223,"owners_count":19672305,"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":["activity","tracker","tracking","webiny"],"created_at":"2024-11-07T17:12:49.580Z","updated_at":"2025-02-19T10:23:10.786Z","avatar_url":"https://github.com/webiny.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Insight\nInsight is a user tracker which will assign appropriate score for a defined set of actions. Each user will have a level based on the provided score.\n\nA simple use case: assign a score of “1” for every time a user opens his dashboard. Assign a score of, say, “5” for each article a user publishes. Each time these actions are performed Insight will track it and update the user’s score.\n\nUsers with higher score are your power users that actively engage with your website or a product.\n\nThe app works only with Webiny platform and the User entity provided with the platform. It’s fine if you have extended the entity with your own, it should still work.\n\nInsight has 3 main concepts:\n* Rules\n* ScoreCard\n* Tracker\n\n## Rules\nThey describe an action a user can perform. Each rule has a name, description, score and a slug.\n\nFor each time a user performs this action, the defined score amount will be assigned to his total score.\n\n## ScoreCard\nThis is your core view, it shows you all your registered users ranked by their level.\n\nThe level is based on the power of 2.  i.e.\nSay level 3, that equals to 2^3, which equals to score of 8, and since previous level equals to score of 4 (2^2), the range for level 3 is score of 5 - 8.\n* Level 4 (2^4): 9 - 16\n* Level 5 (2^5): 17 - 32\n* Level 6 (2^6): 33 - 64\n…you get the point\n\nScore card shows you the total user score as well as a breakdown of which actions he performed, how many times, when was the last time he performed that action and the total score for that action.\n\n## Tracker\nEvery rule has a slug, using that slug you need to call the tracker in your app, once the action has been performed. Tracker is a client side JS class which has to be declared as a dependency to your Webiny app.\n\n### Declaring a dependency\n`Insight.Shared` is the dependency you need to declare\n\nInside your app template add it to the app list in the header:\n```html\n\u003cscript type=\"text/javascript\"\u003e\n    var Webiny = {apps: ['Your.App', 'Insight.Shared'], router: {baseUrl: '/', title: '%s | Webiny'}};\n\u003c/script\u003e\n```\n\nAs well as inside the body (this step is optional but will speed up your initial app load):\n```\n{webiny apps=\"Your.App,Insight.Shared\"}\n```\n\n### Calling the tracker\nInside your code, create an instance of the `Eye` class and call the `glance` method giving the rule slug as the parameter. Here is sample:\n```js\nimport Webiny from 'Webiny';\n\nconst eye = new Webiny.Insight.Plugins.Eye;\neye.glance('user-profile-page');\n```\n\nInsight will take care of the rest.\n\n## License and Contributions\n\nContributing \u003e Feel free to send PRs.\n\nLicense \u003e [MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebiny%2Finsight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebiny%2Finsight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebiny%2Finsight/lists"}