diff options
| author | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 14:33:25 +0700 |
|---|---|---|
| committer | trisusilo48 <tri.susilo@altama.co.id> | 2024-07-02 14:33:25 +0700 |
| commit | e8ad23dbad5e96dddcd6b10bdc46400c6721e80b (patch) | |
| tree | fafea81669ea00f824260ecb4a0acc9e1096499f /src/core/utils | |
| parent | c6eec1fcd70c878f9fa4911ae4ebf1a1c97a18b7 (diff) | |
| parent | 66d787499d0751365c1cda9d79b31e9f3c3c28bc (diff) | |
Merge branch 'release' into feature/generate_recomendation
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': |
