@activeprospect/leadconduit-stats
A command line utility for aggregate reporting on leads
Last updated 7 months ago by mikebetts .
UNLICENSED · Original npm · Tarball · package.json
$ cnpm install @activeprospect/leadconduit-stats 
SYNC missed versions from official npm registry.

LeadConduit Statistics

Aggregate outcome reporting for LeadConduit events. All queries are performed and results given in the account's time zone.

Build Status

Library Usage

Install to your project:

npm install @activeprospect/leadconduit-stats --save

Then invoke the function passing the query options:

const stats = require('@activeprospect/leadconduit-stats');

const options = {
  projectId: '12345',
  readKey: '67890'
};

stats options, (err, results) ->
  if (err) throw err;
  console.log(results);

Query Options

The below options are supported:

Option Description Default Options
projectId Required Keen project ID none none
readKey Required Keen API read key none none
start Include events that occured at this time or after Today, beginning of day Any Date or date String in ISO8601 format
end Include events that occured at this time or before Today, end of day Any Date or date String in ISO8601 format
columns The columns to aggregate (or Array of outcomes) source-success, source-failure, source-error See the "Columns" section below
types The event type to aggregate (or Array of event types) source source, recipient, filter, feedback-received, feedback-sent
by_lead Boolean indicating whether to count unique leads or unique events (true counts by lead) true Boolean
interval Groups results into sub-timeframes spanning a specified length of time none minutely, hourly, daily, weekly, monthly, yearly
group_by Groups results categorically, by co-occurrence of the specified property (provide an Array of properties to group on multiple) none Any event property
rules Array of rules to filter events [{ lhv: 'type', op: 'ne', rhv: 'filter' }]' Array of Rules
timezone When an interval is specified, this time zone will be used to set the start and end of each interval UTC Any tz database time zone name (i.e. America/Chicago) or the number of seconds to offset time from UTC (i.e. -18000)
format The result format to return json json, csv
Columns

The following columns are supported. The default columns are success, failure, and error.

  • success — count the number of events with a success outcome
  • failure — count the number of events with a failure outcome
  • error — count the number of events with an error outcome
  • source — count the number of source events
  • recipient — count the number of recipient events
  • filter — count the number of filter events
  • feedback-received — count the number of feedback-received events
  • feedback-sent — count the number of feedback-sent events
  • {{event type}}-{{outcome}} — count the number of a specific type of event with a success, failure, or error outcome
  • {{feedback type}}-received — count the number of a specific type of feedback received events with a success outcome
  • {{feedback type}}-received-{{outcome}} — count the number of a specific type of feedback received events with a success, failure, or error outcome
  • {{feedback type}}-sent — count the number of a specific type of feedback sent with a success outcome
  • {{feedback type}}-sent-{{outcome}} — count the number of a specific type of feedback received sent with a success, failure, or error outcome
  • cost — the sum of all matching events' cost property
  • revenue — the sum of all matching events' revenue property
  • profit — the difference between revenue and cost
  • cost-per-conversion-received-success — the cost for each successful conversion that occurred for the leads submitted during the specified timeframe

The {{outcome}} placeholders can be replaced with any outcome: success, failure, error, or submitted. The submitted outcome isn't a true outcome and represents the success, failure, and error outcomes as one. The {{feedback type}} placeholders can be replaced with any feedback type. Currently the feedback types supported by the LeadConduit UI are return and conversion. The {{event type}} placeholders can be replaced with: source, recipient, filter, feedback-received, or feedback-sent.

CLI Usage

To use the command line library for LeadConduit Stats, first install it globally:

npm install @activeprospect/leadconduit-stats -g

Then run the help to see all the options. The only required option is the API Key.

$ leadconduit-stats --help
Usage: leadconduit-stats

Options:
  --api-key   Alpha-numeric LeadConduit API key  [required]
  --start     Start time for query in ISO8601 format  [default: "2017-10-05T00:00:00"]
  --end       End time for query in ISO8601 format  [default: "2017-10-05T23:59:59"]
  --column    The column to aggregate  [array] [default: ["success","failure","error","feedback-received","feedback-sent"]]
  --type      The event type to aggregate  [array] [default: ["source"]]
  --interval  Groups results into sub-timeframes spanning a specified length of time: minutely, hourly, daily, weekly, monthly, yearly
  --group-by  Groups results categorically, by co-occurrence of the specified property  [array] [default: ["vars.source.name","vars.flow.name"]]
  --rule      Include only events that match this rule (i.e. 'vars.source.name is equal to "Fluent"')  [array] [default: ["type is equal to \"source\""]]
  --format    Format for query results: json or csv  [default: "csv"]
  --help      Show help  [boolean]

Current Tags

  • 4.2.4                                ...           latest (7 months ago)
  • 4.2.0-rc.4                                ...           prerelease (a year ago)

22 Versions

  • 4.2.4                                ...           7 months ago
  • 4.2.3                                ...           8 months ago
  • 4.2.2                                ...           9 months ago
  • 4.2.1                                ...           a year ago
  • 4.2.0                                ...           a year ago
  • 4.2.0-rc.4                                ...           a year ago
  • 4.2.0-rc.3                                ...           a year ago
  • 4.2.0-rc.2                                ...           2 years ago
  • 4.2.0-rc.1                                ...           2 years ago
  • 4.2.0-rc.0                                ...           2 years ago
  • 4.1.0                                ...           2 years ago
  • 4.0.1                                ...           2 years ago
  • 4.0.0                                ...           2 years ago
  • 3.0.5                                ...           3 years ago
  • 3.0.4                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 24
Last Month 70
Dependencies (9)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |