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

Add feature usage observer #4131

Merged
merged 25 commits into from
Jan 26, 2024
Merged

Add feature usage observer #4131

merged 25 commits into from
Jan 26, 2024

Conversation

cristian-ungureanu
Copy link
Contributor

@cristian-ungureanu cristian-ungureanu commented Nov 2, 2023

Summary

Monitor the usage of various features across Customizer, Modules, etc. for people who allow tracking.

Will affect visual aspect of the product

NO

Testing

Note

Test together and read some additional info on https://github.com/Codeinwp/neve-pro-addon/pull/2667 .

Warning

Install the latest version of Otter. The base tracking package is not in this build.

Make sure that that page does not crash. This update should not modify any functionality.

⚠️ Make sure to have Tracking on.

image

Important

While you test the options (Customizer, dashboard) , some events will be registered. Once you make sure that the functionality is not affected, post the URL of you instance so I can check if the events have been received.

Check before Pull Request is ready:

Closes https://github.com/Codeinwp/neve-pro-addon/pull/2667

@pirate-bot pirate-bot added the pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) label Nov 2, 2023
@cristian-ungureanu cristian-ungureanu added the pr-checklist-skip Allow this Pull Request to skip checklist. label Nov 2, 2023
@pirate-bot pirate-bot added pr-checklist-complete The Pull Request checklist is complete. (automatic label) and removed pr-checklist-incomplete The Pull Request checklist is incomplete. (automatic label) labels Nov 2, 2023
@pirate-bot
Copy link
Collaborator

pirate-bot commented Nov 2, 2023

Plugin build for ac72d42 is ready 🛎️!

@cristian-ungureanu
Copy link
Contributor Author

cristian-ungureanu commented Nov 3, 2023

How to set up the dummy server.

ℹ️ You will need Node/Bun with MongoDB (preferably with Docker)

Server script: https://pastebin.com/1VVwEE9i | package.json script: https://pastebin.com/nAdydQHQ

Install with npm ci and run with node server.js or bun server.js

For mongo, open docker and run this command:

docker run -d --name tracking-db-mongo -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin mongo

You will need to create a database with name neve and a collection with name tracking. If you use the Mongo Compass app this can be done by pressing the plus button in the top-left area near the Databases label.

Other info

JS tracking script: https://github.com/Codeinwp/themeisle-sdk/blob/fix/tracking/assets/js/src/tracking.js

PHP tracking script: https://github.com/Codeinwp/neve/blob/feat/track/inc/core/tracker.php

JS Script usage.

Use set function to set an event and a key that allows you to change it. Use this when you want the event to have the last values.

Use add function for things that do not change frequently or to register unique events. This function uses the set function, and the key is the hash of the object.

ℹ️ Consult the source code to see different options for those functions.

Use start, stop, refresh to start an interval for sending an event once in 5 minutes. This is not usually necessary since events are sent automatically when the user exits the page or saves the post in Post Editor.

package.json Outdated Show resolved Hide resolved
Copy link
Member

@HardeepAsrani HardeepAsrani left a comment

Choose a reason for hiding this comment

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

LGTM, we can update the endpoint with the live one after testing.

@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Nov 28, 2023
@preda-bogdan preda-bogdan merged commit aca9b41 into development Jan 26, 2024
15 of 16 checks passed
@preda-bogdan preda-bogdan deleted the feat/track branch January 26, 2024 13:09
@pirate-bot
Copy link
Collaborator

🎉 This PR is included in version 3.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants