From 699aaa0f2e50962849733cc0df3a7f42fe562a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bergstr=C3=B6m?= Date: Mon, 13 Nov 2023 17:17:53 -0300 Subject: [PATCH] feat: analytics.js 2.2.0 Main change being supporting `additionalAttribution`. PR: https://github.com/Topsort/analytics.js/pull/214 --- .eslintrc.cjs | 4 +-- .github/workflows/checkpr.yml | 1 - CHANGELOG.md | 11 +++++++ README.md | 21 +++++-------- package.json | 2 +- pnpm-lock.yaml | 2 +- tests/test.html | 59 ++++++++++++++++++++++++++++++----- tsconfig.json | 18 +++-------- tsconfig.types.json | 20 +++--------- 9 files changed, 80 insertions(+), 58 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 31ba603..664d129 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -13,9 +13,7 @@ module.exports = { ecmaVersion: 13, sourceType: "module", }, - plugins: [ - "vitest" - ], + plugins: ["vitest"], rules: { "@typescript-eslint/no-explicit-any": "off", }, diff --git a/.github/workflows/checkpr.yml b/.github/workflows/checkpr.yml index fcd13b9..9bff270 100644 --- a/.github/workflows/checkpr.yml +++ b/.github/workflows/checkpr.yml @@ -15,7 +15,6 @@ env: node_version: "18" pnpm_version: "8" - # This is to avoid running multiple actions when a PR is updated repeatedly. See # https://docs.github.com/en/actions/using-jobs/using-concurrency concurrency: diff --git a/CHANGELOG.md b/CHANGELOG.md index ef5ddce..2a0122e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ The format is loosely based on [Keep a Changelog](https://keepachangelog.com/en/ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). We follow the format used by [Open Telemetry](https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md). +## Version 2.2.0 (2023-11-13) + +### Added + +- support passing `additionalAttribution` + +### Refactor + +- Stop publishing to codebuild/s3 +- Update dependencies + ## Version 2.1.0 (2023-08-30) ### Added diff --git a/README.md b/README.md index aea3dbf..eb1589d 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ npm install @topsort/analytics.js --save url: "https://api.topsort.com", // change this if you want to test against the staging environment }; - + ``` ### Add markup to your products @@ -39,24 +39,16 @@ Either mix quotes (single/double) or escape certain characters inside your value const newvalue = currentvalue.replace('"', """).replace("'", "'"); // etc. ``` -Add the following markup to promoted products: +Add the following markup to promoted products: + ```html -
- ... -
+
...
``` and the following for organic products (which is optional) + ```html -
- ... -
+
...
``` 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. @@ -93,6 +85,7 @@ Finally, in case you are using banners and want to have further control on the a ... ``` + # E2E tests Execute `npm run test:e2e`, at the end it will show you the url you need to visit to test the library. diff --git a/package.json b/package.json index b626fe3..445401e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@topsort/analytics.js", - "version": "2.1.0", + "version": "2.2.0", "description": "JS library to automatically report events to Topsort's Analytics", "main": "dist/ts.js", "type": "module", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a22c160..33aea06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true diff --git a/tests/test.html b/tests/test.html index b8366f3..3042557 100644 --- a/tests/test.html +++ b/tests/test.html @@ -10,7 +10,11 @@ td.ok { background-color: #66bb6a; } - #vanilla-js, #root, a:active, a:visited, a:hover { + #vanilla-js, + #root, + a:active, + a:visited, + a:hover { color: white; } button { @@ -75,15 +79,54 @@
-
P
-
P
- -
P
+
+ P +
+
+ P +
+
+ +
+
+ P +
P
-
H
+
+ H +
- - + +