2
0

🐛 Fix GA not working when Send_to is empty string

This commit is contained in:
Baptiste Arnaud
2023-06-12 10:33:04 +02:00
parent 290b491e53
commit 0a87386305
3 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@typebot.io/js", "name": "@typebot.io/js",
"version": "0.0.62", "version": "0.0.63",
"description": "Javascript library to display typebots on your website", "description": "Javascript library to display typebots on your website",
"type": "module", "type": "module",
"main": "dist/index.js", "main": "dist/index.js",

View File

@@ -37,10 +37,10 @@ const initGoogleAnalytics = (id: string): Promise<void> =>
export const sendGaEvent = (options: GoogleAnalyticsOptions) => { export const sendGaEvent = (options: GoogleAnalyticsOptions) => {
if (!options) return if (!options) return
gtag('event', options.action, { gtag('event', options.action, {
event_category: options.category, event_category: options.label?.length ? options.category : undefined,
event_label: options.label, event_label: options.label?.length ? options.label : undefined,
value: options.value as number, value: options.value as number,
send_to: options.sendTo, send_to: options.sendTo?.length ? options.sendTo : undefined,
}) })
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "@typebot.io/react", "name": "@typebot.io/react",
"version": "0.0.62", "version": "0.0.63",
"description": "React library to display typebots on your website", "description": "React library to display typebots on your website",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",