Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@findify/analytics
Advanced tools
Readme
Findify Analytics helps you integrate our Feedback API on the website and gather all the user behavior analytics that our ML and personalization platform require.
Install the analytics package using npm:
npm install @findify/analytics --save
or yarn
yarn add @findify/analytics
Alternatively, you can use UMD builds, by requiring them to the page using <script>
tag.
To use the analytics in the browser, simply add the following script tag to your HTML pages:
<script src="https://cdn.jsdelivr.net/npm/@findify/analytics@latest/dist/findify-analytics.jss"></script>
Upgrading to v2.0.x
introduces breaking changes,
due to the fact that the internal implementation of analytics has been almost completely rewritten.
So you would need to make changes accordingly.
The goal of this rewrite was to address a lot of issues that have plagued analytics since its initial release. We have done our best to make analytics v2 as API compatible with v1.x as possible, however there are some breaking changes that we decided we needed to make, intentionally, in order to support the new architecture and also improve the usability of the library long-term.
In this guide, we will go over the braking changes and how to upgrade your code to address them. Hopefully this will make your upgrade path that much easier. If during the upgrade you run into any issues, feel free to file an issue or contact us directly.
If you're using version from CDN, then just update the bundle version from 1.1.x
to 2.0.14
.
For example, if the current version that you are using is 1.4.43
then you'll need to change the URL in the corresponding <script>
tag in your HTML pages (you can search by analytics-js
) from:
https://d3nhg2i1zayjpd.cloudfront.net/analytics-js/prod/findify-analytics.1.1.43.min.js
to:
https://d3nhg2i1zayjpd.cloudfront.net/analytics-js/prod/findify-analytics.2.0.14.min.js
If you're using npm or yarn, then just install the latest version of https://www.npmjs.com/package/findify-analytics package from npm.
from:
var FindifyAnalytics = require('findify-analytics');
var client = FindifyAnalytics.init({ key: 'your_api_key', events: {}, platform: 'your_platform' });
to:
var findifyAnalytics = require('findify-analytics');
var client = findifyAnalytics({ key: 'your_api_key' });
client.initialize();
.getUser()
calls and replace them with .user
Thats it! :wink:
There are no breaking changes in API, but that package lives under @findify scope on npm.
If you're using npm or yarn, then just install the latest version of @findify/analytics package from npm instead of the old one.
Otherwhise, if you're using it from CDN (as UMD) then you'll need to change the URL in the corresponding <script>
tag in your HTML pages (you can search by analytics-js
) from:
https://d3nhg2i1zayjpd.cloudfront.net/analytics-js/prod/findify-analytics.x.x.x.min.js
to:
https://d3nhg2i1zayjpd.cloudfront.net/analytics-js/prod/3.0.2/findify-analytics.min.js
where x.x.x
is your current version.
Usually, you want to do this on "document ready" event to collect all the data from HTML tags.
var findifyAnalytics = require('@findify/analytics');
var client = findifyAnalytics({ key: 'your_api_key' });
Where key
is your Merchant API key that can be found in your Merchant Dashboard.
Now the client
instance is ready to be used for sending requests to Findify.
client.sendEvent('click-suggestion', {
rid: 'request_id',
suggestion: 'Black t-shirt'
});
Here is the full list of event types:
click-suggestion
click-item
redirect
purchase
update-cart
redirect
purchase
update-cart'
add-to-cart
view-page
For more information take a look at the usage example and documentation.
var findifyAnalytics = require('@findify/analytics');
// Firts, initialize the library
var client = findifyAnalytics({
key: 'your_api_key',
});
// After library iis nitialized, you can start sending event requests to server with `client` instance.
// Let's perform click-suggestion request:
client.sendEvent('click-suggestion', {
rid: 'request_id',
suggestion: 'Black t-shirt'
});
// You can get `user` instance, which can be used further in `findify-sdk` library:
var user = client.user;
// You can listen for events that are sent through our analytics with `listen` function
var unsubscribe = client.listen(function(event, payload) {
console.log(event); // outputs event name
console.log(payload); // outputs event payload
});
We will try to follow semver as close as possible. That means bug fixes will be patch releases (1.0.1 -> 1.0.2), additional functionality like new endpoints will be minor releases (1.0.1 -> 1.1.0) and breaking changes to both the library and the API endpoints it hits, will be major releases (1.0.1 -> 2.0.0).
We use the GitHub issues for tracking bugs and feature requests.
findify-analytics
If you encounter a bug with the Findify analytics package we would like to hear about it. Search the existing issues and try to make sure your problem doesn’t already exist before opening a new issue. When creating an issue, please include the version of the analytics package, Node.js or browser environment and OS you’re using. Please include a stack trace and steps to reproducethe error, if applicable.
The GitHub issues are intended for bug reports and feature requests. For help and questions with using the Findify analytics package please make use of the resources listed in the Getting help section.
Please see CONTRIBUTING.md for information on how to contribute, setup the development environment and run tests.
MIT
FAQs
Findify analytics
The npm package @findify/analytics receives a total of 301 weekly downloads. As such, @findify/analytics popularity was classified as not popular.
We found that @findify/analytics demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.