diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 15:37:19 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 15:37:19 +0700 |
| commit | 5724e3b75c9bcb568d123fe86135205df1bb1c76 (patch) | |
| tree | 6ae46a1d8408d181d01d9569f52e86f5ccc7d76a /src/core/utils | |
| parent | f287fc062c4ceb5039b5ca946da2e6854c27b007 (diff) | |
| parent | f7b024585b70f1bd600ba5e0d26368c532ac9723 (diff) | |
Merge branch 'release' into feature/step_approval
# Conflicts:
# src-migrate/modules/product-detail/components/PriceAction.tsx
# src/lib/transaction/components/Transaction.jsx
# src/pages/index.jsx
Diffstat (limited to 'src/core/utils')
| -rw-r--r-- | src/core/utils/auth.js | 2 | ||||
| -rw-r--r-- | src/core/utils/googleTag.js | 24 | ||||
| -rw-r--r-- | src/core/utils/whatsappUrl.js | 2 |
3 files changed, 26 insertions, 2 deletions
diff --git a/src/core/utils/auth.js b/src/core/utils/auth.js index a7244747..03b20ae2 100644 --- a/src/core/utils/auth.js +++ b/src/core/utils/auth.js @@ -29,7 +29,7 @@ const setAuth = (user) => { * @returns {boolean} - Returns `true`. */ const deleteAuth = async() => { - // await signOut() + await signOut() deleteCookie('auth') return true } 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': |
