🐛 Fix GA not working when Send_to is empty string
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user