1

We have squeezely implementation added to track few events on our website. Some of them are Standard once while some are custom, but issue is from any of the event we cannot track user's phoneNumber. Can some one guide us if the phone number added is correct or not ?

Initially I have just added phone number to a custom event "ProductPurchase" but it does not seems to be working .

Here is the code snippet (Frontend code is in Reactjs/Nextjs)

window.dataLayer.push({
            event: 'ProductPurchase',
            storeID : xxxxxxxxxxxxx,
            Convenience : xxxxxxxxxxxxx,
            ecommerce: {
                purchase: {
                    actionField: {
                        ....
                    },
                    products: xxxxxxxxxxxxx,
                    profile:{
                        "email":emailID,
                        "phone": phoneNumber,
                        "firstname": firstname,
                        "lastname": lastname,
                        "country": "countryName",
                        "city": window.localStorage.getItem('city')
                    }
                }
            }
        });

Phone number comes from localStorage this way --> let phoneNumber = Number(localStorage.getItem('shipping_phone_number'));

Addition to this I have also tried passing phoneNumber in standard event : "Purchase"

window.dataLayer.push({
            event: 'Purchase',
            "phone": phoneNumber,
        });

If any one has tried this before do let me know if the way I have implemented is correct.

Thanks in Adv.

I have tried the above 2 ways but phone number does not seems to be pushed.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy