Opened 5 years ago

Last modified 4 days ago

#472 new New feature

Custom Events analytics, event tracking

Reported by: matt Owned by: matt
Priority: critical Milestone: 2.2.0 - Piwik 2.2.0
Component: Plugins Wishlist Keywords:
Cc: Sensitive: no

Description (last modified by matt)

This ticket is about adding powerful Custom events feature to Piwik.

Use cases:

  • Mobile events analytics
  • API analytics #4178
  • JS error tracking #4977
  • Offline tracking, Retail analytics
  • Tracking actions by users or customers
    • Getting useful aggregate reports on these actions, overall, averages, relative values.
  • Web form analytics #562

An EVENT is defined by:

  • Category
  • Action
  • Name
  • Value

Event Metrics are in Events Overview report:

  • Total number of events
  • Unique events
  • Visits with events
  • Events/visit
  • Event value
  • Average event value AVG(custom_float)

MAIN REPORTS:

  • Top Event Category (total events, unique events, event value, avg+min+max value)
  • Top Event Action (total events, unique events, event value, avg+min+max value)
  • Top Event Name (total events, unique events, event value, avg+min+max value)

COMPOSED REPORTS

  • Top Category > Actions X
  • Top Category > Names X
  • Top Actions > Categories X
  • Top Actions > Names X
  • Top Names > Actions X
  • Top Names > Categories X

UI

  • Overview at the top (graph + Sparklines)
  • Below show the left menu UI selector

Not MVP (move to other ticket)

  • On hover on any row: Show % of total events
  • Add min value metric, max value metric in tooltip
  • List event scope Custom Variables Names > Custom variables values > Event Names > Event Actions
  • List event scope Custom Variables Value > Event Category > Event Names > Event Actions

Done before 2.2.0:

  • Tracking API (Javascript and HTTP)
    • trackEvent( category, action, [name], [value] )
  • Events Segments
  • Display events in Live/ Visitor log / Visitor profile

Done in 2.2.0:

References:

Change History (67)

comment:1 Changed 5 years ago by matt (mattab)

  • Milestone changed from Stable release to Features requests - after Piwik 1.0

comment:2 Changed 5 years ago by matt (mattab)

  • Priority changed from major to critical

comment:3 Changed 5 years ago by matt (mattab)

  • Summary changed from event tracking in Piwik to Plugin to provide event tracking

comment:4 Changed 5 years ago by matt (mattab)

  • Component changed from Core to New Plugin

comment:5 Changed 4 years ago by geneellis

Has there been any development in this area?

comment:6 Changed 4 years ago by matt (mattab)

  • Sensitive unset

geneellis, not so far.

comment:7 Changed 3 years ago by vipsoft (robocoder)

We can avoid some duplication in piwik.js by using the existing JavaScript tracking API, i.e., .trackLink(url, linkType, customData).

comment:8 Changed 3 years ago by vipsoft (robocoder)

  • Milestone changed from Feature requests to 1.x - Piwik 1.x

comment:9 Changed 3 years ago by vipsoft (robocoder)

  • Milestone changed from 1.x - Piwik 1.x to Feature requests

Ok defer to 2.x pe email w/ matt

comment:10 Changed 3 years ago by matt (mattab)

Simple Events tracking is now possible in Piwik 1.5, using Custom Variables per page view feature.

This is explained in the forum post: http://forum.piwik.org/read.php?3,76580,78086#msg-78086

If this is useful enough, maybe we could produce a Documentation page to explain this technique, and label it as "Simple Event Tracking".

comment:11 follow-up: Changed 2 years ago by mofle

Any updated on this?

Piwik needs real event tracking if it wants to compete with Google Analytics.

comment:12 in reply to: ↑ 11 Changed 2 years ago by aribao

I agree with mofle, Piwik needs real event tracking.

Imho this should go to 2.0 milestone

comment:13 Changed 2 years ago by thomcraver

I agree, as well. Event tracking in very important in tracking microconversions. Whether a video interaction (play, completion, etc), map interaction or even jquery tabs on a page, it goes a long way to deciphering visitor intention and behavior.

Any progress on this?

comment:14 Changed 2 years ago by matt (mattab)

It is already possible to do basic Event tracking in Piwik by using Custom Variable of scope "page". You can track for example

  • A custom variable Action: name="Video", value="Play" or "Pause" or "Share"
  • A custom variable Video category: name="Category", value="Biography"
    • Once you track these custom variables, the events reporting will be in Visitors > Custom Variables. The report contains each event name (Video, Category) which are clickable to display the sub tables.
    • For each event and value, the Piwik metrics are displayed: number of visits, pageviews, revenue, time on site, etc.
  • You can also track custom Page titles in Actions > Page titles. In the javascript, see piwikTracker.trackPageView("Video/Hello world"); would track a page view in a category "Video" called "Hello world".

See also the documentation for custom variables: http://piwik.org/docs/custom-variables/

comment:15 Changed 23 months ago by matt (mattab)

If we could allow events via pageviews, without increasing page view counts, we could allow very nice new reports such as "how many visits scroll down to a certain DIV" or "how many read the article until the end", as is demoed in this jquery GA plugin: http://robflaherty.github.com/jquery-scrolldepth/

Would be nice to be able to do this in Piwik! This would ideally require that page views tracking events (with custom variables) do not increase the pageview counter.

comment:16 Changed 22 months ago by frpet1

While "event tracking" a la GA style isn't present, is it possible to extend the amount of custom variables that can be used to 10+, instead of 5?

comment:17 Changed 14 months ago by matt (mattab)

yes we could consider increasing amount of custom variables. Please create a ticket for this request, and we will see how many people are interested.

comment:18 Changed 12 months ago by matt (mattab)

  • Milestone changed from Feature requests to 2.x - Piwik 2.x

As part of work on Page Speed reports in #1700 we added a new column in the link_visit_action table, called "custom_float". This is used to track page performance time, but could also be reused for an Event Tracking mechanism. Most event models have a numeric value (to track time progress, counts, scores, etc.).

A perfect use case for Event tracking could be to setup Automatic Youtube videos tracking (see article).

I think Event Tracking would be a great fit sometime in 2.X!

comment:19 Changed 7 months ago by matt (mattab)

  • Description modified (diff)

comment:20 Changed 7 months ago by matt (mattab)

  • Description modified (diff)

comment:21 Changed 6 months ago by matt (mattab)

  • Description modified (diff)
  • Milestone changed from 2.x - Piwik 2.x to 2.0 - Piwik 2.0
  • Owner set to matt
  • Summary changed from Plugin to provide event tracking to Custom Events analytics, event tracking

comment:23 Changed 6 months ago by matt (mattab)

In 3760ca1fd8fe6e62b9480bf88780e70c8e160b90:

Tracker refactor + fix bug in bulk authentication + Cleanup some of Transitions code refs #472

comment:24 Changed 6 months ago by matt (mattab)

In 5bd392159297693a06fa0086ba25292ad0a8d79b:

Preparing for New Action Event type refs #472

comment:26 Changed 6 months ago by matt (mattab)

In 821b73991988bd738707a00c754a9bbc4af34c79:

refs #472 Adding Javascript API for tracking Event + Javascript tests

comment:27 Changed 6 months ago by matt (mattab)

In b194c902cdb117075eaeff7435d80828a9ea5ea9:

Refs #472 Adding events in other tests to make sure events don't regress

comment:28 Changed 6 months ago by matt (mattab)

In 03805c84c3a4774de52104b6b10ba833d661da9c:

Refs #472 Custom Events are now displayed especially in the visitor log (with new icon) and in the Live API output

<row>

<type>event</type>
<url>http://example.org/movies</url>
<pageIdAction>12</pageIdAction>

<pageId>16</pageId>
<eventCategory>Movie</eventCategory>
<eventAction>play50%</eventAction>
<eventName>Spirited Away (千と千尋の神隠し)</eventName>
<timeSpent>1320</timeSpent>
<timeSpentPretty>22 min 0s</timeSpentPretty>
<icon>plugins/Zeitgeist/images/event.png</icon>

</row>

comment:29 Changed 6 months ago by matt (mattab)

In b2bc0c9cd2184d45899bbfa87aae0b518f8a24ad:

Custom events Major update in 2.0-b3 refs #472

comment:30 Changed 6 months ago by matt (mattab)

In 0eb23975a3f42cdf7035c9903de09e80c94e269c:

Refs #472 Move some logic to TableLogAction

comment:31 Changed 6 months ago by matt (mattab)

In 335ba1881a41ac6f7e9989bd372fde8d4821e720:

Refs #472 PrivacyManager support for Custom Events, so that when old data is purged, it works as expected for purging Segments as well.

comment:32 Changed 5 months ago by matt (mattab)

In 2bc6f2158912418272f532ded4957354eb2d726a:

Refs #472 trimming event attributes and adding test ensuring labels are not truncated

comment:33 Changed 5 months ago by matt (mattab)

In d16c46fa55ff72a61311a89a3a487535d79e0fae:

Refs #472 move getIdActionFromSegment to TableLogAction class

comment:34 Changed 5 months ago by matt (mattab)

In b3491bf680740b96fe6b7204864703b64bf19803:

Refs #472 adding Events segments: eventCategory and eventAction and eventName and eventValue segments and some tests

comment:35 Changed 5 months ago by matt (mattab)

In a57f6b6e9b23cc5d7a8f6a2ac6fa9bf68a8ac43b:

Refs #472 Making eventValue match work by only matching events actions + adding test

comment:37 Changed 5 months ago by matt (mattab)

In 641e9ce4aca81ddb3d66983aab80e477727a1d93:

Refs #472 Adding Events Segments tests

comment:39 Changed 5 months ago by matt (mattab)

In 58f92f2cfe942d68baf7a7e99f2d3754c44aa185:

Refs #472 Enabling plugin by default in 2.0

comment:40 Changed 5 months ago by hpvd

how could one test it?
which syntax has to be embedded on the website?

"global ticket" for (core) plugin doc http://dev.piwik.org/trac/ticket/4298
was the result of these questions...

comment:41 Changed 4 months ago by matt (mattab)

  • Milestone changed from 2.0 - Piwik 2.0 to 2.1 - Piwik 2.1

Event Tracking is implemented in Piwik 2.0. Event Reporting will be added in a later release! Custom Plugins can already make use of the event data.

comment:42 Changed 4 months ago by matt (mattab)

  • Description modified (diff)

comment:43 Changed 4 months ago by hpvd

just noticed you have changed and detailed the description and ToDos.

Don't know if I get everything right or maybe it's already included but I'm missing one thing from which I have thought it would be one of the most interesting statistics:

Often you have a site like a blog post, a product details site or similar
where you can find

  • an image gallery light-box where you want to know until which image the user is clicking
  • a video where you are interested in until which minute the user is watching
  • a css/js tab menu where you want to know which tabs are looked at

...

all this could be tracked via this great new event function and
=> it would be very very interesting for this use-case to have an detailed overview of "events per site"

what do you think?

comment:44 Changed 4 months ago by matt (mattab)

detailed overview of "events per site"

I think this should be covered by what I'm planning to implement!

comment:45 Changed 4 months ago by matt (mattab)

  • Description modified (diff)

comment:46 Changed 2 months ago by matt (mattab)

  • Milestone changed from 2.1 - Piwik 2.1 to 2.0.4 - Piwik 2.0.4

Consolidating milestones FTW

comment:47 Changed 2 months ago by matt (mattab)

  • Priority changed from critical to major

comment:48 Changed 2 months ago by matt (mattab)

  • Milestone changed from 2.1 - Piwik 2.1 to 2.2 - Piwik 2.2

Entering 2.1 RC cycle, moving all other tickets to 2.2 milestone!

comment:49 Changed 5 weeks ago by matt (mattab)

  • Milestone changed from 2.2 - Piwik 2.2 to 2.1.1 - Piwik 2.1.1

comment:50 Changed 2 weeks ago by matt (mattab)

  • Description modified (diff)

comment:51 Changed 7 days ago by matt (mattab)

In 2da00df9c6c72f67ed231ce176de371f64809f8c:

Refs #472 Removing $mappingFromNameToId as it seems unused

comment:52 Changed 7 days ago by matt (mattab)

In 50f66a2e241e9c9cfc0f12bde7218c37c0b66644:

Refs #472 Define event metrics translations in new hook

comment:53 Changed 7 days ago by matt (mattab)

In 2891c3ed5e8c6cad539947dd5f76af7488a9d531:

Refs #472 Moved events translations from core translation file to plugin

comment:54 Changed 7 days ago by matt (mattab)

In c3d78269d2492976e94c4990a10a4228c33703e9:

Refs #472 Custom Events Archiver and API

comment:55 Changed 7 days ago by matt (mattab)

In 2c05a430dcfdcf33adf7d960c09138ecf9fba049:

Refs #472 Custom events translations

comment:56 Changed 7 days ago by matt (mattab)

  • Description modified (diff)
  • Milestone changed from 2.2.1 - Piwik 2.2.1 to 2.2.0 - Piwik 2.2.0
  • Priority changed from major to critical

comment:57 Changed 7 days ago by matt (mattab)

In 836cfc64da116304fd8f8cdbbea2b47b4171d156:

Refs #472 Add metadata for Custom Events reports (for scheduled reports, piwik mobile)

comment:58 Changed 6 days ago by matt (mattab)

  • Description modified (diff)

comment:59 Changed 6 days ago by matt (mattab)

In 755f5ccd489ac35bc57fc71b841423261f181b3b:

Refs #472 Rounding values for mysqli build + introducing "Events with a value"

comment:60 Changed 6 days ago by matt (mattab)

In a9446f721a65a2b3210adcd33d1ec8ae4c78b0b3:

Refs #472 New metrics: Average Event value, Number of events with value.

comment:61 Changed 6 days ago by matt (mattab)

In e5b28b3c623782aa0416dcecc0e7ad40dcc8a1bc:

Refs #472 Events controller with left menu selector

comment:63 Changed 5 days ago by matt (mattab)

In ccbd9ccf29b54d3b28baa615a6b4446e1f0ef07c:

refs #472 Adding secondaryDimension parameter to the Events API + Tests

comment:64 Changed 5 days ago by matt (mattab)

In c34bbad167987a0821a4c8c26aee5f7fc3e241fa:

refs #472 Adding secondaryDimension parameter to the Events API + Tests

comment:65 Changed 4 days ago by matt (mattab)

In 082b17d5c0c036d0dda039951cd35af3141377b9:

Refs #472 Introducing Secondary Dimension selector in the footer to let you choose which "sub table dimension" should be loaded
eg. when flattening the table, or clicking to load a subtable, you can choose between Event Category / Event Name / Event Action

comment:66 Changed 4 days ago by matt (mattab)

In c30e62e68271c5c6494a91e97df674d34d80cbea:

Refs #472 Events reporting interface

comment:67 Changed 4 days ago by matt (mattab)

In 4e7ed602bbbfb8ac4db5bac752c9dc2850a66157:

refs #472 text to change dimension now for the report "Event Actions" will be "Secondary dimension is Event Name. Switch to: Event Category"

Note: See TracTickets for help on using tickets.