From bb5b789e15e87cb1d973af7d6780194f4b7d4ebb Mon Sep 17 00:00:00 2001 From: Matias Peralta Date: Thu, 9 May 2024 18:13:07 -0300 Subject: [PATCH] [FIX] facebook_pixel_tracking: purchase tracking --- facebook_pixel_tracking/__manifest__.py | 2 +- .../static/src/js/website_sale_tracking.js | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/facebook_pixel_tracking/__manifest__.py b/facebook_pixel_tracking/__manifest__.py index 30b876e0..ae06aeb7 100644 --- a/facebook_pixel_tracking/__manifest__.py +++ b/facebook_pixel_tracking/__manifest__.py @@ -20,7 +20,7 @@ { 'name': 'Facebook Pixel Tracking', 'category': 'website', - 'version': "16.0.1.0.0", + 'version': "16.0.1.1.0", 'author': 'ADHOC SA', 'website': 'www.adhoc.com.ar', 'license': 'AGPL-3', diff --git a/facebook_pixel_tracking/static/src/js/website_sale_tracking.js b/facebook_pixel_tracking/static/src/js/website_sale_tracking.js index 2181217a..e12dab30 100644 --- a/facebook_pixel_tracking/static/src/js/website_sale_tracking.js +++ b/facebook_pixel_tracking/static/src/js/website_sale_tracking.js @@ -32,6 +32,7 @@ odoo.define("facebook_pixel_tracking.tracking", function (require) { 'content_type': 'product', 'value': product_price, 'total': amount, + 'currency': 'ARS', } this._pushInfo('AddToCart', dict); }, @@ -46,6 +47,7 @@ odoo.define("facebook_pixel_tracking.tracking", function (require) { 'content_ids': [product_sku || product_id], 'content_type': 'product', 'value': product_price, + 'currency': 'ARS', } this._pushInfo('AddToCart', dict); }, @@ -75,7 +77,26 @@ odoo.define("facebook_pixel_tracking.tracking", function (require) { 'event':'purchase', 'ecommerce':info } - this._pushInfo('OnPurchaseConfirm', dict); + const dict2 = { + value: 115.00, + currency: 'USD', + contents: [ + { + id: '301', + quantity: 1 + }, + { + id: '401', + quantity: 2 + }], + content_type: 'producto prueba' + } + + // this._pushInfo('OnPurchaseConfirm', dict); + fbq('track','Purchase', dict); + fbq('track','OnPurchaseConfirm', dict); + fbq('track','Purchase', dict2); + fbq('track','OnPurchaseConfirm', dict2); this._super(...arguments); }, })