All docs

Goals & funnels

A goal is anything you want to count besides a pageview: a signup, a click, a section someone scrolled to.

Goals without JavaScript

<button data-dp-goal="start_trial" data-dp-goal-plan="pro">Start trial</button>

<section data-dp-scroll="saw_pricing_table">…</section>

data-dp-goal fires on click, and any data-dp-goal-* attribute becomes a property of the goal. data-dp-scroll fires once per page view when the section comes into view.

Goals from code

datapenny('goal', 'signup', { plan: 'pro' });
// shorter, the DataFast way:
datapenny('signup', { plan: 'pro' });

DataFast’s attributes (data-fast-goal, data-fast-goal-*, data-fast-scroll) and window.datafast() calls work too.

Goals from your server

For things that happen off the page, such as a trial being activated, send the goal from your server with a site’s payment key (dpk_…):

curl https://YOUR-DATAPENNY-URL/api/v1/goals \
  -H "Authorization: Bearer dpk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "visitor_id": "VISITOR_ID_FROM_THE_BROWSER", "name": "trial_activated", "props": { "plan": "pro" } }'

datapenny_visitor_id and datafast_visitor_id work in place of visitor_id, and metadata in place of props. An unknown visitor gets a 404.

Reading them

The Goals panel lists completions and the revenue from visitors who completed each one. Clicking a goal filters the whole dashboard to the sessions that did it. Insights shows which goals lead to a sale.

Funnels

A funnel is 2 to 6 ordered steps. Each step is a page, a goal or a payment, and a payment can only be the last step. A page path ending in * matches everything under it, so /blog/* covers every post. A site can have up to 20 funnels.

Each step counts the visitors who did it at or after the step before, within the date range. Funnels are worked out when you open them, so a new funnel covers the past too.