How to get a user_id (phone number identifier)

I’d like to use third-party tracking tool, called ‘cauly’ in Korea. But I can’t get a contact (phone number) identifier from my contact form. Also, I don’t know how to prevent duplicate phone number at dataset. Plz help me…

Hello MASK,

Follow this tutorial i f you need to connect your contact form to a database so that you may store and retrieve the data. If it is in a database, all you would have to do is query the database for that user and find the phone number field.

Code would look something like this:

import 'wix-data' from wixData;

wixData.query('myCollection').eq('phoneNumber', phoneNumber).find()
    .then((result) => {
         console.log(result.item[0])          //the item that matches the phone number above
         //Here you would send a .postMessage() with the phone number or whole item to your html component     that has 'cauly'
     }).catch((err) => {
         console.log(err);
     })

postMessage API

Goodluck!
Majd

1 Like