{"id":20496471,"url":"https://github.com/hardpixel/woopra-track","last_synced_at":"2026-03-05T07:35:50.950Z","repository":{"id":56898397,"uuid":"103260053","full_name":"hardpixel/woopra-track","owner":"hardpixel","description":"Tracking library for woopra.com. Woopra analytics client-side and server-side tracking helper.","archived":false,"fork":false,"pushed_at":"2020-03-06T11:31:16.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-03T17:54:48.334Z","etag":null,"topics":["gem","ruby","woopra"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/hardpixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-12T11:07:11.000Z","updated_at":"2020-03-06T11:31:14.000Z","dependencies_parsed_at":"2022-08-20T17:40:40.149Z","dependency_job_id":null,"html_url":"https://github.com/hardpixel/woopra-track","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hardpixel/woopra-track","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpixel%2Fwoopra-track","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpixel%2Fwoopra-track/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpixel%2Fwoopra-track/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpixel%2Fwoopra-track/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hardpixel","download_url":"https://codeload.github.com/hardpixel/woopra-track/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hardpixel%2Fwoopra-track/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30114316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","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":["gem","ruby","woopra"],"created_at":"2024-11-15T18:07:16.618Z","updated_at":"2026-03-05T07:35:50.908Z","avatar_url":"https://github.com/hardpixel.png","language":"Ruby","readme":"# WoopraTrack\n\nTracking library for [woopra.com](https://www.woopra.com). Woopra analytics client-side and server-side tracking helper.\n\n[![Gem Version](https://badge.fury.io/rb/woopra_track.svg)](https://badge.fury.io/rb/woopra_track)\n[![Build Status](https://travis-ci.org/hardpixel/woopra-track.svg?branch=master)](https://travis-ci.org/hardpixel/woopra-track)\n[![Code Climate](https://codeclimate.com/github/hardpixel/woopra-track/badges/gpa.png)](https://codeclimate.com/github/hardpixel/woopra-track)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'woopra_track'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install woopra_track\n\n## Usage\n\nTo enable tracker in a ActionController controller, include the `WoopraTrack` concern in your class:\n\n```ruby\nclass PagesController \u003c ApplicationController\n  include WoopraTrack\nend\n```\n\nYou can then configure the tracker in your controller. For example, if you want to set up tracking with Woopra on your homepage, the controller should look like and then you will have the `@woopra` instance variable available:\n\n```ruby\nclass PagesController \u003c ApplicationController\n  def home\n    config = { domain: 'website.com' }\n    woopra(request, config)\n\n    # Your code here...\n  end\nend\n```\n\nYou can also customize all the properties of the woopra during that step by adding them to the `config_hash`. For example, to also update your idle timeout (default: 30 seconds):\n\n```ruby\n# Using woopra function\nconfig = { domain: 'website.com', idle_timeout: 15000 }\nwoopra(request, config)\n\n# Using @woopra instance variable\n@woopra.config({ idle_timeout: 15000 })\n```\n\nTo add custom visitor properties, you should use the `identify` function:\n\n```ruby\n@woopra.identify({\n  email:   'johndoe@website.com',\n  name:    'John Doe',\n  company: 'Business'\n})\n```\n\nIf you wish to identify a user without any tracking event, don't forget to `push` the update to woopra:\n\n```ruby\n# Push through front-end\n@woopra.identify(user_hash)\n@woopra.push\n\n# Push through back-end\n@woopra.identify(user_hash)\n@woopra.push(true)\n```\n\nIf you wish to track page views, just call `track`:\n\n``` ruby\n# Front-end tracking:\n@woopra.track\n\n# Back-end tracking:\n@woopra.track(true)\n```\n\nYou can also track custom events through the front-end or the back-end. With all the previous steps done at once, your controller should look like:\n\n``` ruby\nclass PagesController \u003c ApplicationController\n  include WoopraTrack\n\n  def home\n    # Initialize and configure woopra tracker\n    config = { domain: 'website.com', idle_timeout: 15000 }\n    woopra(request, config)\n\n    # Identify user\n    @woopra.identify({\n      email:   'johndoe@website.com',\n      name:    'John Doe',\n      company: 'Business'\n    })\n\n    # Track a custom event through the front end...\n    @woopra.track('play', {\n      artist: 'Dave Brubeck',\n      song:   'Take Five',\n      genre:  'Jazz'\n    })\n\n    # ... and through the back end by passing the optional argument `true`\n    @woopra.track('signup', {\n      company:  'Business',\n      username: 'johndoe',\n      plan:     'Gold'\n    }, true)\n\n    # Enable front-end tracking\n    @woopra.track\n\n    # Your code here...\n  end\nend\n```\n\nand add the code in your template's header (here `home.html.erb`)\n\n```erb\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003c!-- Your header here... --\u003e\n    \u003c%= woopra_javascript_tag %\u003e\n  \u003c/head\u003e\n   \u003cbody\u003e\n    \u003c!-- Your body here... --\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nIf you wish to track your users only through the back-end, you should set the cookie on your user's browser. However, if you are planning to also use front-end tracking, don't even bother with that step, the JavaScript tracker will handle it for you.\n\n``` ruby\n# During initialization\nconfig = { domain: 'website.com', idle_timeout: 15000 }\nwoopra(request, config, cookies)\n\n# Using set cookie function\n@woopra.set_cookie(cookies)\n```\n\nIf you want to enable logging for back-end tracking requests, just call `enable_logging`:\n\n``` ruby\n@woopra.enable_logging\n```\n\nYou can also disable tracking globally, by setting `disable_tracking` to `true` in the config hash.\n\n``` ruby\nconfig = { domain: 'website.com', idle_timeout: 15000, disable_tracking: true }\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/hardpixel/woopra-track.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardpixel%2Fwoopra-track","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhardpixel%2Fwoopra-track","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhardpixel%2Fwoopra-track/lists"}