Share feedback, ideas and get community help

D
F
M
a
g

Issue with Typebot Integration in WordPress: Passing UTM Variables

Hello, community!

I am trying to integrate Typebot into my WordPress site and facing an issue related to passing UTM variables.

What I am trying to achieve:
I want to initialize Typebot directly in my HTML code, passing UTM variables that are necessary to enable the bot's functionality.
The apiHost needs to be just the domain (https://bot.domain.com) and should not include the full URL with parameters.
Example of the code I am using:
html
Copiar código
<script type="module">
import Typebot from 'https://cdn.jsdelivr.net/npm/@typebot.io/[email protected]/dist/web.js';

// Defining UTM variables directly in the code
let utm_email = 'acelmec@gmail.com';
let utm_empresa = 'AM Insurance';
let utm_telefone = '5551999999999';

// Initializing Typebot
Typebot.initBubble({
typebot: "consorcios",
apiHost: "https://bot.domain.com",
previewMessage: {
message: "Can we help you?",
autoShowDelay: 10000,
avatarUrl: utm_url_banner,
},
theme: {
button: { backgroundColor: "#0042DA" },
chatWindow: { backgroundColor: "#fff" },
},
// UTM variables
variables: {
utm_assinatura: utm_assinatura,
utm_email: utm_email,
utm_empresa: utm_empresa,
utm_telefone: utm_telefone,
utm_url_banner: utm_url_banner
}
});
</script>
The problem:
When I initialize Typebot, it is not recognizing the UTM variables that I am trying to pass, and the bot does not function correctly.

Questions:
How can I ensure that these variables are passed correctly to Typebot?
Is there any additional configuration that I should consider for Typebot to work as expected?
I appreciate any help you can offer!
.
1 comment
The correct term instead of variables would be prefilledVariables. Have you tried using it?
https://docs.typebot.io/editor/variables#prefilled-variables
Add a reply
Sign up and join the conversation on Discord
Join
The problem:When I initialize Typebot, it is not recognizing the UTM variables that I am trying to pass, and the bot does not function correctly.Questions:How can I ensure that these variables are passed correctly to Typebot?Is there any additional configuration that I should consider for Typebot to work as expected?I appreciate any help you can offer!","url":"https://community.typebot.io/questions-and-bug-reports-1f0FwSyXPX30/issue-with-typebot-integration-in-wordpress-passing-utm-variables-mC79b3gWTRjn","identifier":"mC79b3gWTRjn","publisher":{"@type":"Organization","name":"Typebot","logo":{"@type":"ImageObject","url":"https://assets.usehall.com/org_01J5WY498Z4HFNZA1D6GQGBV59/079223ba-f2d1-4825-8243-501026f6f74c.png"}},"author":{"@type":"Person","url":"https://community.typebot.io/members/a6b3c778-d1bc-4279-9150-4bdbb89fcf7c","name":"trader.acmattos","identifier":"a6b3c778-d1bc-4279-9150-4bdbb89fcf7c","image":"https://cdn.discordapp.com/embed/avatars/5.png"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0}}]