{"id":15566962,"url":"https://github.com/strg-at/behave.tracking-client-vue","last_synced_at":"2025-10-28T03:32:12.748Z","repository":{"id":40737657,"uuid":"272659379","full_name":"strg-at/behave.tracking-client-vue","owner":"strg-at","description":"STRG. beHave tracking-client vue","archived":false,"fork":false,"pushed_at":"2025-01-31T10:41:41.000Z","size":181,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-31T11:30:39.474Z","etag":null,"topics":["behave","javascript","library","strg","vue","vue2"],"latest_commit_sha":null,"homepage":"","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/strg-at.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":"CODEOWNERS","security":null,"support":null,"governance":null}},"created_at":"2020-06-16T08:58:52.000Z","updated_at":"2025-01-31T10:41:45.000Z","dependencies_parsed_at":"2023-02-07T22:31:05.777Z","dependency_job_id":"e14b74e3-e0d9-4bc9-82c4-d11765812758","html_url":"https://github.com/strg-at/behave.tracking-client-vue","commit_stats":{"total_commits":49,"total_committers":8,"mean_commits":6.125,"dds":0.7142857142857143,"last_synced_commit":"bcf5b08df02f95f5aacabc349e90284de4efca9a"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strg-at%2Fbehave.tracking-client-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strg-at%2Fbehave.tracking-client-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strg-at%2Fbehave.tracking-client-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strg-at%2Fbehave.tracking-client-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strg-at","download_url":"https://codeload.github.com/strg-at/behave.tracking-client-vue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590606,"owners_count":19497350,"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":["behave","javascript","library","strg","vue","vue2"],"created_at":"2024-10-02T17:09:07.037Z","updated_at":"2025-10-28T03:32:12.476Z","avatar_url":"https://github.com/strg-at.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vue.js BeHave tracking plugin\n\nClient-side plugin providing a BeHave tracking interface for Vue.js based applications.\n\n## Installation\n\n#### Vue.js setup\n\n    import Vue from 'vue'\n    import VueBehave from '@strg/behave-tracking-client-vue'\n\n    // router and options definition...\n\n    Vue.use(VueBehave, { router, options })\n\n#### Nuxt.js setup\n\n    import Vue from 'vue'\n    import VueBehave from '@strg/behave-tracking-client-vue'\n\n    // options definition...\n\n    export default ({ app: { router } }) =\u003e {\n      Vue.use(VueBehave, { router, options })\n    }\n\n### Router\n\nRouter of your Vue.js application - required if you wish to track `URLs` and `referrers`. If not provided, URL and referrer tracking is automatically disabled.\n\n### Options\n\nObject with the following properties:\n\n- `debugMode` - logs events to console instead of using websocket\n- `urlTracking` - enables / disables url tracking\n- `referrerTracking` - enables / disables referrer tracking\n- `eventKeyUrl`\n- `eventKeyReferrer`\n- `eventKeyClick`\n- `eventKeyScroll`\n- `eventKeyView`\n- `eventContentIdMode` - `default` or `crc32`\n- `config` - behave configuration object\n  - `NAMESPACE`\n  - `CLIENT_STORAGE_NAMESPACE`\n  - `COOKIE_NAME`\n  - `RECONNECT_TIMEOUT`\n  - `ENDPOINT` - required if not in debug mode\n\nThe minimal required options look like this:\n\n    const options = {\n      config: {\n        ENDPOINT: ''  // websocket endpoint\n      },\n    }\n\nOr using the debug mode:\n\n    const options = {\n      debugMode: true\n    }\n\n#### Default Options\n\nUser provided options object gets merged with the defaults during the plugin installation. These are the default values:\n\n    {\n        debugMode: false,\n        urlTracking: true,\n        referrerTracking: true,\n        eventKeyUrl: 'url',\n        eventKeyReferrer: 'referrer',\n        eventKeyClick: 'click',\n        eventKeyScroll: 'scroll',\n        eventKeyView: 'view'\n        eventContentIdMode: 'default',\n        config: {\n            NAMESPACE: 'strgBeHave',\n            CLIENT_STORAGE_NAMESPACE: 'strgBeHave',\n            COOKIE_NAME: 'STRG.BeHaveOptOut',\n            RECONNECT_TIMEOUT: 60000,\n            ENDPOINT: null\n        }\n    }\n\n# Usage\n\nPlugin can track engagement in two ways:\n\n- how user navigates the application\n- how user interacts with specific elements on the page\n\n## Navigation tracking\n\nStarts automatically if `router` is provided. If you wish to disable either url or referrer tracking, you can do so via options' `urlTracking` and `referrerTracking` properties.\n\n## Content Interactions\n\nPlugin exposes three tracking methods available in your components via the `$behave` property.\n\n- `trackScrolling(vm, eventKey, contentId)`\n- `trackClicks(vm, eventKey, contentId)`\n- `trackView(vm, eventKey, contentId)`\n\nWhere:\n\n- `vm` - view model of the component\n- `eventKey` - custom behave event key (optional - falls back to global plugin options)\n- `contentId` - unique identifier of the content in question\n\nExample:\n\n    mounted () {\n      this.$behave.trackClicks(this, 'behave-recommendation-box-1234-teaser-click', 'product-1234')\n    },\n\nBy having access to the view model of your components, plugin can properly unregister events by itself when components get destroyed. This means that as a consumer, you don't need to pollute your application's main logic with additional cleanup code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrg-at%2Fbehave.tracking-client-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrg-at%2Fbehave.tracking-client-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrg-at%2Fbehave.tracking-client-vue/lists"}