From 0ee7434188364dc230bbd034dc165a0f4850e3db Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Sat, 3 Jun 2023 11:16:32 +0700
Subject: Add gtag event on product detail

---
 src/lib/product/components/Product/ProductMobile.jsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src/lib/product/components/Product/ProductMobile.jsx')

diff --git a/src/lib/product/components/Product/ProductMobile.jsx b/src/lib/product/components/Product/ProductMobile.jsx
index 426fe1b8..667a4ba1 100644
--- a/src/lib/product/components/Product/ProductMobile.jsx
+++ b/src/lib/product/components/Product/ProductMobile.jsx
@@ -14,6 +14,7 @@ import { toast } from 'react-hot-toast'
 import { createSlug } from '@/core/utils/slug'
 import BottomPopup from '@/core/components/elements/Popup/BottomPopup'
 import whatsappUrl from '@/core/utils/whatsappUrl'
+import { gtagAddToCart } from '@/core/utils/googleTag'
 
 const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
   const router = useRouter()
@@ -85,6 +86,7 @@ const ProductMobile = ({ product, wishlist, toggleWishlist }) => {
 
   const handleClickCart = () => {
     if (!validAction()) return
+    gtagAddToCart(activeVariant, quantity)
     updateItemCart({
       productId: activeVariant.id,
       quantity,
-- 
cgit v1.2.3

