4.2.4 • Published 5 years ago

@activeprospect/leadconduit-stats v4.2.4

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
5 years ago

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:

OptionDescriptionDefaultOptions
projectIdRequired Keen project IDnonenone
readKeyRequired Keen API read keynonenone
startInclude events that occured at this time or afterToday, beginning of dayAny Date or date String in ISO8601 format
endInclude events that occured at this time or beforeToday, end of dayAny Date or date String in ISO8601 format
columnsThe columns to aggregate (or Array of outcomes)source-success, source-failure, source-errorSee the "Columns" section below
typesThe event type to aggregate (or Array of event types)sourcesource, recipient, filter, feedback-received, feedback-sent
by_leadBoolean indicating whether to count unique leads or unique events (true counts by lead)trueBoolean
intervalGroups results into sub-timeframes spanning a specified length of timenoneminutely, hourly, daily, weekly, monthly, yearly
group_byGroups results categorically, by co-occurrence of the specified property (provide an Array of properties to group on multiple)noneAny event property
rulesArray of rules to filter events[{ lhv: 'type', op: 'ne', rhv: 'filter' }]'Array of Rules
timezoneWhen an interval is specified, this time zone will be used to set the start and end of each intervalUTCAny tz database time zone name (i.e. America/Chicago) or the number of seconds to offset time from UTC (i.e. -18000)
formatThe result format to returnjsonjson, 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]
4.2.4

5 years ago

4.2.3

5 years ago

4.2.2

5 years ago

4.2.1

5 years ago

4.2.0

5 years ago

4.2.0-rc.4

5 years ago

4.2.0-rc.3

5 years ago

4.2.0-rc.2

5 years ago

4.2.0-rc.1

5 years ago

4.2.0-rc.0

5 years ago

4.1.0

6 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.0.5

7 years ago

3.0.4

7 years ago

3.0.3

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

2.0.0

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago