Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matomo tracker update #376

Merged
merged 13 commits into from
Jul 13, 2021
Merged

Matomo tracker update #376

merged 13 commits into from
Jul 13, 2021

Conversation

Mikearaya
Copy link
Contributor

@Mikearaya Mikearaya commented Jun 23, 2021

currently, the Product category is not available (in publicare context) unless we use tags here after.

@Mikearaya Mikearaya marked this pull request as ready for review June 23, 2021 19:00
@Mikearaya Mikearaya requested a review from pozylon June 23, 2021 19:02
Copy link
Member

@pozylon pozylon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not tracking orders and carts correctly...

Tracking Cart Updates in Matomo (Optional)

To track cart additions and removals, your cart system will need to send the details for every item that remains in the cart after a user adds or removes an item, including those already submitted from prior Add to Cart clicks. This is important to collect accurate information for the abandoned cart feature within Matomo. The data should be included within a “push”, which is the function that enables sending of structured data to Matomo via JavaScript. You will also need to supply the total value of all items in the cart. so the two required elements for cart tracking are:

A push of 'addEcommerceItem' for each product currently in the cart, including the name and SKU at a minimum.
A final 'trackEcommerceCartUpdate' push with the cart total passed as a parameter.

Can't see trackEcommerceCartUpdate anywhere or removeEcommerceItem or clearEcommerceCart...

This will not be very stable like this I guess...

@@ -2,28 +2,31 @@ import fetch from 'isomorphic-unfetch';
import { encode } from 'querystring';
import { subscribe } from '../director';

const extractOrderParameters = (orderPosition) => {
const parseCurrency = (amount) => parseFloat(amount / 100).toFixed(2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you do a parseFloat here? Please use accounting package if you do divide and toFixed. Else we will have problems with the float handling of js (http://openexchangerates.github.io/accounting.js/)

@Mikearaya
Copy link
Contributor Author

Mikearaya commented Jun 24, 2021

@pozylon ok, noted. i used parseFloat to provide the correct value as int/float and not string since it's required

@pozylon
Copy link
Member

pozylon commented Jun 24, 2021

@Mikearaya Can you please stale this PR for the moment and copy the Matomo Tracker Plugin to the Publicare Repository so we have everything in one place. We can re-add it back to the engine once it works as expected.

@pozylon pozylon marked this pull request as draft June 24, 2021 18:15
@pozylon
Copy link
Member

pozylon commented Jul 13, 2021

Introduced async_hooks async context through meteor 2.3 (node 14), will be the base for reading context data in a future matomo tracker version

@pozylon pozylon marked this pull request as ready for review July 13, 2021 20:51
@pozylon pozylon merged commit 9dcad33 into master Jul 13, 2021
@pozylon pozylon deleted the matomo-tracker-update branch July 13, 2021 20:51
@Mikearaya
Copy link
Contributor Author

@pozylon nothing is being registered in the context yet right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants