QUIQQER - Matomo - With new E-Commerce Tracking

in #utopian-io5 years ago (edited)

QUIQQER - Matomo



The Matomo QUIQQER Module integrates Matomo into QUIQQER. Matomo is the leading open-source analytics platform that gives you more than just powerful analytics.

By using the Matomo plugin you save the trouble of manually embedding the Matomo tracking Codes for all of your different project in to all of their pages. The Matomo plugin takes care of all of this.

Repository

New Features

What feature(s) did you add?

Because we prepare QUIQQER for the E-Commerce world, also every shop owner would like to have some statistics about the buying behaviour of his users.

In version 1.3 the Matomo QUIQQER module now also integrates e-commerce tracking. The shopping cart, product handling, ordering process behavior, all this is now included in the statistics.

How did you implement it/them?

So that the statistics module can react to the different events, we have integrated new events into the order module.

  • Global Event: onQuiqqerProductsOpenProduct
  • Global Event: onQuiqqerProductsCloseProduct
  • Global Event: onQuiqqerOrderProcessOpenStep
  • Global Event: onQuiqqerOrderProcessFinish
  • Basket Event: onAdd
  • Basket Event: onRemove
  • Basket Event: onClear

Events are certain happenings that may occur at some point and that can be addressed via the QUIQQER API. Since these changes are not yet available in any version and are included in the Order Release, I will not go into them here.

To make the whole thing easy to handle, we have outsourced the e-commerce tracking to an own file. This is no problem due to the events integration.

https://github.com/QUIQQER/package-piwik/blob/master/bin/eCommerceTracking.js

If the Order Module is installed, the Tracking Module will include this file on each page.

The complete e-commerce tracking is loaded asnycron and thus the loading performance for the user is not affected.

How does the process work?
  • User visits the page
  • E-commerce tracking is being loaded
  • E-Commerce module relies on different events different tracking methods
  • For example, the user puts a product into the shopping cart.
  • The Order Module fires the Basket Event: onAdd
  • The E-Commerce trackings tracks the product adding

For quick and easy tracking, I have implement various util functions for this purpose:

I don't have a screenshot of every function, as this would simply be too much code

getTrackData.png

trackUserDeleteStart.png

trackUserDelete.png

I hope I was able to give you a small overview which changes the new statistics version has to offer. As soon as our order module is in the stable version, everything is ready for a successful start with your own shop.

The tracking in e-commerce will now be tested for a few weeks in our services and corrected in case of possible errors. So that everything runs stable when we release the order system.

Little hint
I know that we can use let and const, but since we have IE11 compatibility and IE11 has some bugs in let and const usage, we can't change our code right now. And I don't want to add an additional compilation step.

GitHub Account

Thanks for reading,
Hen and Jan, for PCSG Developers

Sort:  

Thank you for your contribution. I am taking the changes from 1/Mar for the review as the utopian guidance says a 14-day window.

  1. In here you probably can check product for null only.
  2. here - you can convert the boolean to integer using (boolean) cast

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @justyy! Keep up the good work!

Hi @pcsg-dev!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.32
TRX 0.11
JST 0.034
BTC 66761.99
ETH 3256.83
USDT 1.00
SBD 4.27