diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b59ddfb..8eca9ab 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: NPM install - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x @@ -31,7 +31,7 @@ jobs: run: npm run test - name: Archive npm failure logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: npm-logs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db135f2..f2c5f34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,10 +26,10 @@ jobs: needs: confirm-public-repo-master-branch steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: NPM install - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x @@ -43,7 +43,7 @@ jobs: run: npm run test - name: Archive npm failure logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: npm-logs @@ -57,7 +57,7 @@ jobs: - confirm-public-repo-master-branch steps: - name: Checkout development branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: mparticle-integrations/mparticle-javascript-integration-google-analytics-4 ref: development @@ -101,7 +101,7 @@ jobs: run: | git pull origin release/${{ github.run_number }} - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x @@ -118,7 +118,7 @@ jobs: npx semantic-release - name: Archive npm failure logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: npm-logs @@ -135,7 +135,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout master branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 repository: ${{ github.repository }} diff --git a/packages/GA4Client/package-lock.json b/packages/GA4Client/package-lock.json index 4d67a98..481915f 100644 --- a/packages/GA4Client/package-lock.json +++ b/packages/GA4Client/package-lock.json @@ -23215,4 +23215,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/packages/GA4Client/src/commerce-handler.js b/packages/GA4Client/src/commerce-handler.js index 9d70c4c..e679d5b 100644 --- a/packages/GA4Client/src/commerce-handler.js +++ b/packages/GA4Client/src/commerce-handler.js @@ -435,6 +435,9 @@ function parseProduct(product, affiliation) { case 'Variant': productWithAllAttributes.item_variant = product.Variant; break; + case 'Position': + productWithAllAttributes.index = product.Position; + break; case 'Attributes': break; default: diff --git a/packages/GA4Client/test/src/tests.js b/packages/GA4Client/test/src/tests.js index 2c0b998..a9f688c 100644 --- a/packages/GA4Client/test/src/tests.js +++ b/packages/GA4Client/test/src/tests.js @@ -303,7 +303,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -319,7 +319,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -806,7 +806,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -820,7 +820,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1071,7 +1071,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1085,7 +1085,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1169,7 +1169,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1183,7 +1183,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1352,7 +1352,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1366,7 +1366,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -1989,7 +1989,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -2252,7 +2252,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, test4ever___: 'tester', @@ -2268,7 +2268,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -2354,7 +2354,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -2371,7 +2371,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -2456,7 +2456,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999, @@ -2473,7 +2473,7 @@ describe('Google Analytics 4 Event', function () { item_id: 'iphoneSKU', item_name: 'iphone', item_variant: 'variant', - position: 1, + index: 1, price: 999, quantity: 1, total_amount: 999,