feat: revenue tracking

* wip

* wip

* wip

* wip

* show revenue better on overview

* align realtime and overview counters

* update revenue docs

* always return device id

* add project settings, improve projects charts,

* fix: comments

* fixes

* fix migration

* ignore sql files

* fix comments
This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-19 14:27:34 +01:00
committed by GitHub
parent d61cbf6f2c
commit 790801b728
58 changed files with 2191 additions and 23691 deletions

View File

@@ -26,6 +26,7 @@ const validator = zProject.pick({
domain: true,
cors: true,
crossDomain: true,
allowUnsafeRevenueTracking: true,
});
type IForm = z.infer<typeof validator>;
@@ -39,6 +40,7 @@ export default function EditProjectDetails({ project }: Props) {
domain: project.domain,
cors: project.cors,
crossDomain: project.crossDomain,
allowUnsafeRevenueTracking: project.allowUnsafeRevenueTracking,
},
});
const trpc = useTRPC();
@@ -155,22 +157,45 @@ export default function EditProjectDetails({ project }: Props) {
control={form.control}
render={({ field }) => {
return (
<WithLabel label="Cross domain support" className="mt-4">
<CheckboxInput
ref={field.ref}
onBlur={field.onBlur}
defaultChecked={field.value}
onCheckedChange={field.onChange}
>
<div>Enable cross domain support</div>
<div className="font-normal text-muted-foreground">
This will let you track users across multiple domains
</div>
</CheckboxInput>
</WithLabel>
);
}}
/>
</AnimateHeight>
<Controller
name="allowUnsafeRevenueTracking"
control={form.control}
render={({ field }) => {
return (
<WithLabel label="Revenue tracking">
<CheckboxInput
className="mt-4"
ref={field.ref}
onBlur={field.onBlur}
defaultChecked={field.value}
onCheckedChange={field.onChange}
>
<div>Enable cross domain support</div>
<div>Allow "unsafe" revenue tracking</div>
<div className="font-normal text-muted-foreground">
This will let you track users across multiple domains
With this enabled, you can track revenue from client code.
</div>
</CheckboxInput>
);
}}
/>
</AnimateHeight>
</WithLabel>
);
}}
/>
<Button
loading={mutation.isPending}