https://discord.gg/botpress logo
#🤝help
How To Track Source of Leads?
# 🤝help
a

able-forest-32140

07/14/2023, 7:51 PM
We capture leads within Botpress and then use Zapier to send the data to Google Sheets. However, we are facing a challenge in tracking the source of these leads. For example, one person may have seen our ad on YouTube, visited our website, and subsequently became a lead. Another lead may have originated from Facebook. We need a solution to track the sources of these leads accurately. Do you have any suggestions or ideas on how we can accomplish this?
up 🙂
up
up
up
f

freezing-printer-49373

07/17/2023, 2:46 PM
So your bot is deployed to different channels? Or are you saying you want to account for where the lead initially came from before talking to your bot on your website?
a

able-forest-32140

07/17/2023, 5:36 PM
@freezing-printer-49373 yes. giving you an example. We have deployed our chatbot on our website, and we are capturing leads within the bot and sending them to Zapier. We are wondering how to capture UTMs from the link and send this information to the bot so that when we send the lead data to Zapier, we can also include information about the source of the user.
up
g

gentle-shampoo-88367

07/18/2023, 7:27 PM
just setup the utm's while initiating the bot. This can be done when using configurable bot. Catch the utms on server side in botpress and send to zap as normal variables
a

able-forest-32140

07/19/2023, 1:47 PM
@gentle-shampoo-88367 thank you! I just can't find this "configurable bot". Where to look for it?
g

gentle-shampoo-88367

07/19/2023, 2:10 PM
on you bot dashboard, go to integrations, webchat and configurable

https://cdn.discordapp.com/attachments/1129500376643670036/1131226561031438408/image.png

a

able-forest-32140

07/19/2023, 2:24 PM
thanks!
@gentle-shampoo-88367 could you please help me a little bit more? I have no idea how to catch UTMs with botpress 😄
@gentle-shampoo-88367 I tried this code: var searchParams = new URLSearchParams(window.location.search); var utm_source = searchParams.get('utm_source') || 'none'; var utm_medium = searchParams.get('utm_medium') || 'none'; var utm_campaign = searchParams.get('utm_campaign') || 'none'; window.botpressWebChat.init({ "composerPlaceholder": "Chat with bot", "botConversationDescription": "Ask me about fake Martial Arts Studio.", "botId": "80e5bdcc-1029-4ea5-94b8-209501080e63", "hostUrl": "https://cdn.botpress.cloud/webchat/v0", "messagingUrl": "https://messaging.botpress.cloud", "clientId": "80e5bdcc-1029-4ea5-94b8-209501080e63", "botName": "Test Bot", "avatarUrl": "https://static.vecteezy.com/system/resources/previews/021/282/248/original/adobe-illustrator-circle-icon-for-web-design-free-png.png", "phoneNumber": "+178888888", "termsConditions": "https://andrewpoltavets.pro/terms", "privacyPolicy": "https://andrewpoltavets.pro/privacy", "emailAddress": "hello@info.com", "website": "https://andrewpoltavets.pro/", "stylesheet": "https://webchat-styler-css.botpress.app/prod/4df9c81c-5e8e-4e86-b8c7-e477832c1b7f/v2945/style.css", "utm_source": utm_source, "utm_medium": utm_medium, "utm_campaign": utm_campaign, "showBotInfoPage": false }); and set variables inside the bot. it's not catching it in this way
is this code correct for sending source to zap? it sends everything, but utm_source workflow.zapierSuccess = false const leadData = { name: workflow.name, email: workflow.email, whoFor: workflow.whoFor, whyLessons: workflow.whyLessons, typeOfMartialArt: workflow.typeOfMartialArt, utm_source: workflow.utm_source } try { const response = await axios.post ('https://hooks.zapier.com/hooks/catch/15902982/3m4gb22/', leadData) console.log(response.data) workflow.zapierSuccess = true } catch (error) { console.error(error) }