{"id":16791852,"url":"https://github.com/posabsolute/jquery-behavior-miner","last_synced_at":"2025-03-22T01:30:31.435Z","repository":{"id":7233967,"uuid":"8543075","full_name":"posabsolute/jquery-behavior-miner","owner":"posabsolute","description":"Agitated User Tracking Behavior jQuery Plugin","archived":false,"fork":false,"pushed_at":"2016-09-30T12:56:02.000Z","size":54,"stargazers_count":95,"open_issues_count":0,"forks_count":19,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-18T06:51:23.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/posabsolute.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":"2013-03-03T21:42:03.000Z","updated_at":"2024-02-13T00:20:11.000Z","dependencies_parsed_at":"2022-09-05T03:52:14.636Z","dependency_job_id":null,"html_url":"https://github.com/posabsolute/jquery-behavior-miner","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/posabsolute%2Fjquery-behavior-miner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posabsolute%2Fjquery-behavior-miner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posabsolute%2Fjquery-behavior-miner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posabsolute%2Fjquery-behavior-miner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posabsolute","download_url":"https://codeload.github.com/posabsolute/jquery-behavior-miner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244893303,"owners_count":20527564,"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":[],"created_at":"2024-10-13T08:36:00.740Z","updated_at":"2025-03-22T01:30:31.127Z","avatar_url":"https://github.com/posabsolute.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Agitated User Behavior data miner (jQuery Plugin)\n\nThis plugin tracks behaviors that are considered agitated. The plugin emit events that can be logged in your system, or on Google Analytics (GA plugin  included).\n\nYou can also act on those behaviors by, for example, showing popovers to better guide your user. \n\n## Behaviors tracked\n\nAll behaviors sensibilities are modifiable.\n\n+ Hitting multiple time rapidly a keyboard key\n+ Maintaining multiple keyboard key at the same time\n+ Clicking multiple time a dom element (generally buttons)\n+ Maintaining a long click a dom element (generally buttons)\n+ Highlighting text\n\n## Installation\n\nInclude the plugin into your html, if you want to connect with Google Analytics you must also include the GA file like below.\n\n\t\u003cscript src=\"js/dist/jquery.behaviorminer.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\t\u003c!-- below is the google analitycs plugin --\u003e\n\t\u003cscript src=\"js/connectors/ga.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n\nAfter you can start the plugin on the document:\n\n\t\u003cscript\u003e$(document).behaviorMiner();\u003c/script\u003e\n\n\n## Options\nThe are multiple options included, most importantly you can change the sensibility of the tracked behaviors to better fit your situation. The options presented below are default to the application.\n\n\t\u003cscript\u003e\n\t\t{\n            connector: false, // change to plugin name (example: \"ga\")\n            track : {\n                keymultiplepress:true,\n                repeatkey:true,\n                multipleclick:true,\n                longclick:true,\n                texthighlight:true\n            },\n            sensibility : {\n                multipleclick : 3, // number of click before logging\n                multipleclicktime : 1000, // time elapsed for hitting for clicking the same dom element\n                repeatkey : 3,  // number of same key hit before logging\n                repeatkeytime : 1000, // time elapsed for hitting the same key\n                keymultiplepress : 4, // number of click pressed at the same time before logging\n                longclick: 3000 // time elapsed before conseding a long click\n             }\n        };\n\t\u003c/script\u003e\n\n\n## Emitted event\n\nThe plugin will emit a jquery event on the document that you can catch to act or save data.\n\n\t$(document).on(\"log_user_behavior\", function(e,data){\n\t\tconsole.log(data);\n\t});\n\nExample of the data returned:\n\n\t{\n\t    keys : [multiplekeys],\n\t    timestamp : 234234234234, // javascript timestamp\n\t    url : \"http://www.google.com/\",\n\t    type : \"multiple_keys_hold\",\n\t    behavior : \"User is hitting multiple keyboard keys at once\"\n\t};\n\nDepending of what type of events you are logging the data will minimally change, for keyboard events the plugin return the keys, but for clicks it return the element clicked.\n\n### All the current event type names\n\n+ multiple_keys_hold\n+ same_key_hit_multiple\n+ text_highlight\n+ multiple_clicks\n+ long_clicks\n\n## Connecting to Google analytics and others\n\nbehaviorMiner has a simple plugin architecture, the GA plugin already use it, to enable GA or create your own connector here what you can do.\n\nIn the case of google analytics only enable the data connector and include the javascript file \n\n\t\u003cscript\u003e$(document).behaviorMiner({dataConnector:\"ga\"});\u003c/script\u003e\n\nIf you want to create your own connector please base yourself on the plugin provided (jquery.behaviorMiner.ga.js). Change for your own connector name, when the plugin is intanciated the *init()* function will be automatically loaded.\n\nThe options are automatically passed to the connectors, you can retrive them using *this.options*.\n\n## Adding behaviors\n\nTo add a behavior, first add your own js file into /behaviors, follow this namespace convention\n\n\t$.behaviorMiner.behaviors.name\n\nAfter that, when launching the plugin add the behavior name to the track option\n\n\t\u003cscript\u003e$(document).behaviorMiner({track:{name:true}});\u003c/script\u003e\n\nWhen the script init your behavior it will call the *load()* method.  The options are automatically passed to the behaviors, you can retrive them using *this.options*.\n\nWhen you are done with your behavior you can send back the data using \n\n\t$(document).trigger(\"behaviorMiner_data\", [data]);\n\n### Adding your new behavior to the minified file\n\nYou can always simply add your behavior file below the plugin in the html document like this:\n\n\t\u003cscript src=\"js/jquery.behaviorminer.min.js\" type=\"text/javascript\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\t\u003c!-- below is the google analitycs plugin --\u003e\n\t\u003cscript src=\"js/behavior/name.js\" type=\"text/javascript\" charset=\"utf-8\"\u003e\u003c/script\u003e\n\nOr you can compile your behavior in the minified script using grunt, first *load npm install* to install dependencies, then just do grunt and it's all automatic. You must comply with jslint before a compilation is completed. If that sound complicated please check gruntjs, it should be simple to pick it up from there.\n\n## Contributors\n\nOriginal idea by Jonathan LeBlanc (https://github.com/jcleblanc) \n\n## License (MIT)\n\nCopyright 2013 Cedric Dugas\nhttp://me.position-absolute.com\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposabsolute%2Fjquery-behavior-miner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposabsolute%2Fjquery-behavior-miner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposabsolute%2Fjquery-behavior-miner/lists"}