Merge pull request #455 from Budibase/more-analytics-events
More analytics events
This commit is contained in:
commit
681ce35755
|
@ -12,7 +12,12 @@ function captureException(err) {
|
||||||
Sentry.captureException(err)
|
Sentry.captureException(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function captureEvent(event) {
|
||||||
|
posthog.capture(event)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
activate,
|
activate,
|
||||||
captureException,
|
captureException,
|
||||||
|
captureEvent,
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { fade } from "svelte/transition"
|
import { fade } from "svelte/transition"
|
||||||
import { post } from "builderStore/api"
|
import { post } from "builderStore/api"
|
||||||
|
import analytics from "../../analytics"
|
||||||
|
|
||||||
const { open, close } = getContext("simple-modal")
|
const { open, close } = getContext("simple-modal")
|
||||||
|
|
||||||
|
@ -38,6 +39,11 @@
|
||||||
|
|
||||||
const res = await response.json()
|
const res = await response.json()
|
||||||
|
|
||||||
|
analytics.captureEvent("web_app_created", {
|
||||||
|
name,
|
||||||
|
description,
|
||||||
|
appId: res._id,
|
||||||
|
})
|
||||||
$goto(`./${res._id}`)
|
$goto(`./${res._id}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
notifier.success(`Your Deployment is Complete.`)
|
notifier.success(`Your Deployment is Complete.`)
|
||||||
deployed = true
|
deployed = true
|
||||||
loading = false
|
loading = false
|
||||||
|
analytics.captureEvent("web_app_deployment", {
|
||||||
|
appId,
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
analytics.captureException(err)
|
analytics.captureException(err)
|
||||||
notifier.danger("Deployment unsuccessful. Please try again later.")
|
notifier.danger("Deployment unsuccessful. Please try again later.")
|
||||||
|
|
|
@ -46,3 +46,8 @@ module.exports = async port => {
|
||||||
const server = http.createServer(app.callback())
|
const server = http.createServer(app.callback())
|
||||||
return server.listen(serverPort || 4001)
|
return server.listen(serverPort || 4001)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
process.on("SIGINT", function() {
|
||||||
|
console.log("\nGracefully shutting down from SIGINT")
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
|
Loading…
Reference in New Issue