Adlens

Help · Start

Custom events

Send a named event with a few properties from your page, and count it by page and property.

Send an event #

Once the tag is on the page, call adlens with a name and up to a few properties:

adlens("signup", { plan: "free" });

Events go out at once. Property values are sent as text, so 3 arrives as "3". The install guide shows how to queue events that fire before the script loads.

Read them #

The Events view counts each event, the visitors who sent it, and the values of each property.

What they cost #

Each custom event is one event on your plan, the same as a pageview. See Plans and what counts as an event.

Without writing JavaScript #

Put data-adlens-event="name" on any link or button, and a click sends that event. Add properties with data-adlens-prop-<key>="value" on the same element. See Tracker options.

Events sent for you #

  • outbound: a click on a link to another site, with its host.
  • download: a click on a file link (pdf, zip, apk and similar), with the file and its type.
  • form_submit: a form sent, with the form's id, name or action.
  • 404: a page your 404 template marks with data-404.
  • js_error: a JavaScript error on the page, up to 3 per pageview.

They count like any event and can be goals. data-auto="off" turns off the first three, data-errors="off" the errors.

From your server #

Send events from your own code with an API key: see Events from your server.