Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Custom Events analytics, event tracking #472

Closed
mattab opened this Issue · 64 comments

5 participants

Matthieu Aubry Anonymous Piwik user Anthon Pang hpvd David Tintner
Matthieu Aubry
Owner

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

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, [[value](name],) )
  • Events Segments
  • Display events in Live/ [Visitor log](http://piwik.org/docs/real-time/) / [Visitor profile](http://piwik.org/docs/user-profile/)

Done in 2.2.0:

  • Documentation
  • add trackEvent to [Javascript tracker](http://developer.piwik.org/api-reference/tracking-javascript)
  • Add new user manual for [Custom Events Analytics](http://piwik.org/docs/event-tracking/)

References:

  • See Google Analytics API: [image](http://blogoscoped.com/files/google-analytics-event-tracking-large.png), [guide](http://code.google.com/apis/analytics/docs/eventTrackerGuide.html), [extending tracking](http://code.google.com/apis/analytics/docs/eventTrackerWrappers.html)
  • trackEvent(category, action, label, value)
Anonymous Piwik user

Has there been any development in this area?

Matthieu Aubry
Owner

geneellis, not so far.

Anthon Pang
Collaborator

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

Anthon Pang
Collaborator

Ok defer to 2.x pe email w/ matt

Matthieu Aubry
Owner

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".

Anonymous Piwik user

Any updated on this?

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

Anonymous Piwik user

I agree with mofle, Piwik needs real event tracking.

Imho this should go to 2.0 milestone

Anonymous Piwik user

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?

Matthieu Aubry
Owner

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/

Matthieu Aubry
Owner

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.

Anonymous Piwik user

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?

Matthieu Aubry
Owner

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.

Matthieu Aubry
Owner

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!

Matthieu Aubry
Owner

In 15a4fc8: Minor refs #472

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In 5bd3921: Preparing for New Action Event type refs #472

Matthieu Aubry
Owner

In bd298e1: Tracking Custom Events refs #472

Matthieu Aubry
Owner

In 821b739: refs #472 Adding Javascript API for tracking Event + Javascript tests

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In 03805c8: 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>22min0s</timeSpentPretty>
            <icon>plugins/Zeitgeist/images/event.png</icon>
        </row>
Matthieu Aubry
Owner

In b2bc0c9: Custom events Major update in 2.0-b3 refs #472

Matthieu Aubry
Owner

In 0eb2397: Refs #472 Move some logic to TableLogAction

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In 2bc6f21: Refs #472 trimming event attributes and adding test ensuring labels are not truncated

Matthieu Aubry
Owner

In d16c46f: Refs #472 move getIdActionFromSegment to TableLogAction class

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In 5d2f48e: Refs #472 Enabling plugin in tests

Matthieu Aubry
Owner

In 641e9ce: Refs #472 Adding Events Segments tests

Matthieu Aubry
Owner

In 5766bc3: Refs #472 Checking in test files

Matthieu Aubry
Owner

In 58f92f2: Refs #472 Enabling plugin by default in 2.0

hpvd

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

"global ticket" for (core) plugin doc #4298
was the result of these questions...

Matthieu Aubry
Owner

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.

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?

Matthieu Aubry
Owner

detailed overview of "events per site"

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

Matthieu Aubry
Owner

Consolidating milestones FTW

Matthieu Aubry
Owner

In 2da00df: Refs #472 Removing $mappingFromNameToId as it seems unused

Matthieu Aubry
Owner

In 50f66a2: Refs #472 Define event metrics translations in new hook

Matthieu Aubry
Owner

In 2891c3e: Refs #472 Moved events translations from core translation file to plugin

Matthieu Aubry
Owner

In c3d7826: Refs #472 Custom Events Archiver and API

Matthieu Aubry
Owner

In 2c05a43: Refs #472 Custom events translations

Matthieu Aubry
Owner

In 836cfc6: Refs #472 Add metadata for Custom Events reports (for scheduled reports, piwik mobile)

Matthieu Aubry
Owner

In 755f5cc: Refs #472 Rounding values for mysqli build + introducing "Events with a value"

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In e5b28b3: Refs #472 Events controller with left menu selector

Matthieu Aubry
Owner

In a8bb960: Refs #472 Tweaks

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

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

Matthieu Aubry
Owner

In 082b17d: 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

Matthieu Aubry
Owner

In c30e62e: Refs #472 Events reporting interface

Matthieu Aubry
Owner

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

hpvd

great feature!
Just trying to implement this with latest piwik beta 2.2.3 b6.

[update]
hmm now it seem to work!

-comment could be deleted-

hpvd

what is missing in action view (for our usage) is the possibility to see events filtered on site/page level... (please see comment 43)
Or is this planned to be implemented on another place?

hpvd

one futher idea for the usage of custom event statistic is described in this ticket:
"Invers" Custom Event tracking - to find bad elements/functions
#5186

hpvd

another idea/proposal could be find here:
colors for custom events
#5187

hpvd

some more feedback on custom events in tables like vistor log:
#5189

Matthieu Aubry
Owner

Replying to matt:

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.

It's now implemented! See How do I add more than the default 5 custom variables?

Matthieu Aubry
Owner

I'm closing this ticket as it is now implemented.

Please consult this ticket and add your feedback and ideas there: #5231

Matthieu Aubry
Owner

In 0671c4b: Refs #472 Adding documentation in the Events API
this creates an automatic documentation for Events API

Matthieu Aubry
Owner

see also #5257 Application Performance Management & Monitoring

Matthieu Aubry mattab added this to the 2.3.0 - Piwik 2.3.x milestone
Matthieu Aubry mattab self-assigned this
Frederic Hemberger fhemberger referenced this issue from a commit
Matthieu Aubry mattab Refs #472 Tweaks a8bb960
Frederic Hemberger fhemberger referenced this issue from a commit
Matthieu Aubry mattab Refs #472 Introducing Secondary Dimension selector in the footer to l…
…et 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
082b17d
Frederic Hemberger fhemberger referenced this issue from a commit
Matthieu Aubry mattab refs #472 text to change dimension now for the report "Event Actions"…
… will be "Secondary dimension is Event Name. Switch to: Event Category"
4e7ed60
Frederic Hemberger fhemberger referenced this issue from a commit
Matthieu Aubry mattab Refs #472 Adding documentation in the Events API
this creates an automatic documentation for [http://developer.piwik.org/api-reference/reporting-api#Events Events API]
0671c4b
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Some refactoring and preparations for custom events ref #472
PHP Tracker and Tests fixtures
Schema updates
ed9cd9e
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Minor refs #472 15a4fc8
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Tracker refactor + fix bug in bulk authentication + Cleanup some of T…
…ransitions code refs #472
3760ca1
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Preparing for New Action Event type refs #472 5bd3921
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Tracking Custom Events refs #472 bd298e1
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Custom Events are now displayed especially in the visitor l…
…og (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>
03805c8
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Custom events Major update in 2.0-b3 refs #472 b2bc0c9
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Move some logic to TableLogAction 0eb2397
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 PrivacyManager support for Custom Events, so that when old …
…data is purged, it works as expected for purging Segments as well.
335ba18
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 trimming event attributes and adding test ensuring labels a…
…re not truncated
2bc6f21
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 adding Events segments: eventCategory and eventAction and e…
…ventName and eventValue segments and some tests
b3491bf
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Making eventValue match work by only matching events action…
…s + adding test
a57f6b6
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Enabling plugin in tests 5d2f48e
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Adding Events Segments tests 641e9ce
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Checking in test files 5766bc3
Philip Taffner sabl0r referenced this issue from a commit in sabl0r/piwik
Matthieu Aubry mattab Refs #472 Enabling plugin by default in 2.0 58f92f2
Matthieu Aubry
Owner

The Event Tracking guide has been updated

David Tintner

The event tracking guide is not found. link is dead

Matthieu Aubry
Owner

@dmtintner fixed, thanks

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.