{"id":20672124,"url":"https://github.com/workarea-commerce/workarea-listrak","last_synced_at":"2026-04-20T17:02:52.322Z","repository":{"id":56898482,"uuid":"203639766","full_name":"workarea-commerce/workarea-listrak","owner":"workarea-commerce","description":"Integrate Listrak's various services with Workarea","archived":false,"fork":false,"pushed_at":"2020-09-16T18:00:15.000Z","size":1408,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-14T22:53:09.450Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://plugins.workarea.com/plugins/listrak","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workarea-commerce.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-21T18:12:48.000Z","updated_at":"2020-09-16T18:00:17.000Z","dependencies_parsed_at":"2022-08-21T02:20:40.900Z","dependency_job_id":null,"html_url":"https://github.com/workarea-commerce/workarea-listrak","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-listrak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-listrak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-listrak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workarea-commerce%2Fworkarea-listrak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workarea-commerce","download_url":"https://codeload.github.com/workarea-commerce/workarea-listrak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242891329,"owners_count":20202326,"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-11-16T20:32:06.578Z","updated_at":"2026-04-20T17:02:52.281Z","avatar_url":"https://github.com/workarea-commerce.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Workarea Listrak\n================================================================================\n\nIntegrate the [Listrak][] ERP with the Workarea platform. This plugin\ncurrently implements the following Listrak features:\n\n- Page view tracking\n- Cart abandonment\n- Transactional email delivery\n- Automatically subscribing users to a distribution list\n\nGetting Started\n--------------------------------------------------------------------------------\n\nAdd the gem to your application's Gemfile:\n\n```ruby\n# ...\ngem 'workarea-listrak'\n# ...\n```\n\nUpdate your application's bundle.\n\n```bash\ncd path/to/application\nbundle\n```\n\nUpdate your `config/secrets.yml` file with your api credentials:\n\n```yaml\nlistrak:\n  data_api:\n    client_id:\n    client_secret:\n  email_api:\n    client_id:\n    client_secret:\n```\n\nConfiguration\n--------------------------------------------------------------------------------\n\nMost listrak configuration is set via the admin; you will need to set the\n`Default List` in the admin after installing the plugin.\n\n![lisrak admin](./readme/listrak-admin.png)\n\n```ruby\nWorkarea.config do |config|\n  config.listrak.analytics = {\n    merchant_id: 'LISTRAK MERCHANT ID',\n    email_capture_ids: 'EMAIL FIELD IDS USED FOR JAVASCRIPT ABANDONMENT'\n  }\nend\n```\n\nSubscribing email addresses to a distribution list\n--------------------------------------------------------------------------------\n\nWhen customers sign up for the newsletter within the popup dialog or\ncreate a new user account, `Workarea::Listrak` will send the email and\nany other user-specific information to Listrak. This occurs immediately\nin a background job during creation of a `Email::Signup`.\n\nData Exporting\n--------------------------------------------------------------------------------\n\nThe following will be sent to Listrak via API whenever they are created or saved:\n\n* Customers\n* Orders (on order place)\n* Products\n\nTransactional Email Delivery\n--------------------------------------------------------------------------------\n\nThis library is capable of replacing the internal application mailers\nwith API calls to Listrak's email delivery service, passing it the data\nthat it needs. To generate a new transactional message class, run:\n\n```bash\n$ bin/rails generate workarea:listrak:message OrderConfirmation\n```\n\nThis will generate a class `app/messages/workarea/order_confirmation_message.rb`\n\nYou will need to define the `message_id` and `messsage_attribute` as well as define the methods\nfor these values. For example:\n\n```ruby\nmodule Workarea\n  module Listrak\n    class OrderConfirmationEmail\n      include Listrak::TransactionalMessage\n\n      attr_reader :order\n\n      message_id 11838256\n      message_attributes(\n        order_date: 2446175\n      )\n\n      def initialize(order)\n        @order = order\n      end\n\n      private\n\n        def email_address\n          order.email\n        end\n\n        def order_date\n          order.placed_at.to_s\n        end\n  end\nend\n```\n\nTo send the message, call the `#deliver` method:\n\n```ruby\nOrderConfirmationMessage.new(order).deliver\n```\n\nJavaScript Analytics Integration\n--------------------------------------------------------------------------------\n\nAll of Listrak's JS code blocks respond to the `listrakAsyncListener`\nevent, which is triggered after Listrak's external \"SDK\" code is loaded\nonto the page. Workarea's analytics adapter encapsulates this as a public\nmethod called `addListrakListener`.\n\nIt's important that the init function from Storefront's **analytics.js**\nis called prior to the **listrak.js** init, so events can be registered\nbefore the SDK is loaded. This happens out-of-box, but is mentioned here\nif an implementation team creates their own **application.js.erb**\nmanifest manually, or other modules that implement more Listrak features\n(like recommendations) are added to your application in the future.\n\nTo reiterate, **listrak.js needs to be your last initialized JS\nmodule**.\n\n[Listrak]: http://listrak.com\n\nWorkarea Commerce Documentation\n--------------------------------------------------------------------------------\n\nSee [https://developer.workarea.com](https://developer.workarea.com) for Workarea Commerce documentation.\n\nLicense\n--------------------------------------------------------------------------------\n\nWorkarea Listrak is released under the [Business Software License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fworkarea-listrak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkarea-commerce%2Fworkarea-listrak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkarea-commerce%2Fworkarea-listrak/lists"}