CustomerX Tracking Client
It is a service provided by CustomerX, so that its customers can track their actions in their software.
Documentation
This Ruby gem is a wrapper around CustomerX Tracking REST API. Please see our API documentation for more information.
Please check out the class documentation, and issues before reporting a bug or asking for help.
Installation
The CustomerX Tracking client can be installed using Rubygems or Bundler.
Rubygems
gem install customerx_tracking
Bundler
Add it to your Gemfile
gem "customerx_tracking"
and follow normal Bundler installation and execution procedures.
Configuration
require 'customerx_tracking'
CustomerxTracking.config do |c|
# Mandatory:
c.base_url = "<- customerx-tracking-url ->" # e.g. https://tracker.customerx.com.br or https://sandbox.tracker.customerx.com.br
# To perform any tracking action, it is necessary to inform the credential and key that is released when creating a new account in our environments. These credentials identify your company so that the link of the tracking carried out is valid.
c.credential = "your credential"
c.key = "your key"
end
Usage
Actions
Tracker
To make the tracker just start the module CustomerxTracking::Tracker.create
with that enter the parameters for the tracker
Mandatory parameters:
- external_id_client required field
- identifier required field
- type_tracking required field
- email required field
Field Details:
- external_id_client - Your customer code
- type_tracking - What will be tracheated? A screen (screen), an action (action) or a login (login) NOTE: The identifier can be used to generate the tracking record
- identifier - Screen name or action that was performed
- email - Email of the user who performed the operation (NOTE: The email must be linked to a client in our database so that we can make the reference between tracking and our platform
- amount - Total number of operations, not mandatory. If not informed, 1 will be counted for each request, if informed, the amount informed will be counted
- external_id_product - If you need to control tracking by product, just inform the code of the product to be tracked
- external_id_contact - If the email does not exist, the external id of the contact can be sent, so that we can search for this email in our database, we will automatically fill in the email
- date_tracking - If necessary, retroactive tracking can be informed with the date on which the operation was performed, if not, the date of the tracheting moment will be entered. NOTE: Format 04/09/2020
Example:
CustomerxTracking::Tracker.create({
external_id_client: '145206',
identifier: 'report_x',
type_tracking: 'action',
email: 'email@email.com'
})
Note on Patches/Pull Requests
- Fork the project.
- Make your feature addition or bug fix.
- Add tests for it. This is important so that we don't break it in a future version unintentionally.
- Commit. Do not alter
Rakefile
, version, or history. (If you want to have your own version, that is fine, but bump version in a commit by itself that we can ignore when we pull.) - Submit a pull request.