summaryrefslogtreecommitdiff
path: root/src/core/utils
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-21 11:01:35 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-21 11:01:35 +0700
commit220190db66bcc1c6db78180c593f21e9cf8f363c (patch)
tree1517faa9636a6b3b2cc8d468a57b1fe476c229d7 /src/core/utils
parent208b234320b6c42491a4e87a1c3db3abab9c1715 (diff)
parent1cf754b4d8da1aa28700ffc3dad67081f6daf9a5 (diff)
Merge branch 'promotion-program' into feature/all-promotion
Diffstat (limited to 'src/core/utils')
-rw-r--r--src/core/utils/googleTag.js24
-rw-r--r--src/core/utils/whatsappUrl.js2
2 files changed, 25 insertions, 1 deletions
diff --git a/src/core/utils/googleTag.js b/src/core/utils/googleTag.js
index cc6d1283..96a6bd2e 100644
--- a/src/core/utils/googleTag.js
+++ b/src/core/utils/googleTag.js
@@ -33,6 +33,20 @@ const sumTotal = (variants) => {
}
}
+const mapProducts = (product) => {
+ const res = {
+ item_id: product.id,
+ item_name: product.name,
+ discount: product.lowest_price.price_discount || 0,
+ // index: 0,
+ item_brand: product.manufacture.name,
+ item_category: product.categories,
+ item_variant: product.variants,
+ price: product.lowest_price.price,
+ quantity: product.stock_total
+ }
+ return res
+}
export const gtagAddToCart = (variant, quantity) => {
const param = {
currency: 'IDR',
@@ -77,3 +91,13 @@ export const gtagPurchase = (variants, shipping, transactionId) => {
}
gtag('event', 'purchase', param)
}
+
+export const gtagProductDetail = (product) => {
+ const items = mapProducts(product)
+ const param = {
+ currency: 'IDR',
+ value: product.id,
+ items
+ }
+ gtag('event', 'view_item', param)
+} \ No newline at end of file
diff --git a/src/core/utils/whatsappUrl.js b/src/core/utils/whatsappUrl.js
index 9a92f424..7a129aa6 100644
--- a/src/core/utils/whatsappUrl.js
+++ b/src/core/utils/whatsappUrl.js
@@ -7,7 +7,7 @@ const whatsappUrl = (template = 'default', payload, urlPath = null) => {
if(!urlPath) return '/login'
}
let parentName = user.parentName || '-'
- let url = 'https://wa.me/628128080622'
+ let url = 'https://wa.me/6281717181922'
let text = 'Hallo Indoteknik.com,'
switch (template) {
case 'product':