
Security News
TeamPCP Is Systematically Targeting Security Tools Across the OSS Ecosystem
TeamPCP is targeting security tools across the OSS ecosystem, turning scanners and CI pipelines into infostealers to access enterprise secrets.
@topsort/analytics.js
Advanced tools
Topsort's JS analytics event library
Use this to send clicks and impressions to the Topsort API.
With npm
npm install @topsort/analytics.js --save
<script>
window.TS = {
token: "<YOUR-TOPSORT.JS-TOKEN>",
url: "https://api.topsort.com", // change this if you want to test against the staging environment
};
</script>
<script src="https://unpkg.com/@topsort/analytics.js@2.0.0/dist/ts.js"></script>
Either mix quotes (single/double) or escape certain characters inside your values. In javascript:
const newvalue = currentvalue.replace('"', """).replace("'", "'"); // etc.
Pass said values to your html:
<div
class="product"
data-ts-product="<productId>"
data-ts-resolved-bid="<resolvedBidId>"
>
...
</div>
Additionally, in case not all the container is clickable (i.e., does not produce an action or does not take you to the product page) or parts of it lead you to a non-related product page, make sure to use the data-ts-clickable attribute to indicate what portions of the product should count as a conversion.
<div class="product" ...>
<div data-ts-clickable>
<img src="https://cdn.marketplace.com/product.png" />
<span>Product Title</span>
</div>
<span>Help</span>
</div>
Finally, adding further information to purchases can be made by passing the ts-data-items JSON array:
<div
data-ts-action="purchase"
data-ts-items='[{"product": "product-id-purchase-1", "quantity":1, "price": 2399}, {"product": "product-id-purchase-2", "quantity": 2, "price": 399}]'
>
My purchase
</div>
Execute npm run test:e2e, at the end it will show you the url you need to visit to test the library.
Ideally you would check the library both in desktop and mobile browsers. For that you need to be connected to the same network.
FAQs
JS library to automatically report events to Topsort's Analytics
The npm package @topsort/analytics.js receives a total of 166 weekly downloads. As such, @topsort/analytics.js popularity was classified as not popular.
We found that @topsort/analytics.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
TeamPCP is targeting security tools across the OSS ecosystem, turning scanners and CI pipelines into infostealers to access enterprise secrets.

Security News
TypeScript 6.0 introduces new standard APIs, modern default settings, and deprecations as it prepares projects for the upcoming TypeScript 7.0 release.

Security News
/Research
Newly published Trivy Docker images (0.69.4, 0.69.5, and 0.69.6) were found to contain infostealer IOCs and were pushed to Docker Hub without corresponding GitHub releases.