Skip to content

Commit

Permalink
feat: use manual tracking for contact form submits
Browse files Browse the repository at this point in the history
  • Loading branch information
pascaliske committed Nov 10, 2023
1 parent 5a0e4fe commit 55e6be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/pages/contact/contact.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</button>

<button
class="plausible-event-name=Contact+Form+Submit mt-5 min-w-[150px] bg-opacity-75 px-4 py-2 text-ghostWhite transition-colors duration-300 hover:bg-opacity-100 disabled:cursor-not-allowed disabled:bg-paynesGray"
class="mt-5 min-w-[150px] bg-opacity-75 px-4 py-2 text-ghostWhite transition-colors duration-300 hover:bg-opacity-100 disabled:cursor-not-allowed disabled:bg-paynesGray"
type="submit"
[class.cursor-pointer]="state == 'initial'"
[class.pointer-events-none]="state != 'initial'"
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/contact/contact.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { HeadlineComponent } from 'components/headline/headline.component'
import { CopyComponent } from 'components/copy/copy.component'
import { InputComponent } from 'components/input/input.component'
import { SocialsComponent } from 'components/socials/socials.component'
import { plausible } from 'typings'

export interface ContactFormGroup {
prefix: FormControl
Expand Down Expand Up @@ -82,10 +83,12 @@ export class ContactComponent {
complete: () => {
this.state = 'success'
this.reset(5000)
plausible('Contact Form Submit', { props: { type: 'success' } })
},
error: () => {
this.state = 'error'
this.reset(5000, false)
plausible('Contact Form Submit', { props: { type: 'error' } })
},
})
}
Expand Down

0 comments on commit 55e6be9

Please sign in to comment.