Skip to content

Commit

Permalink
feat(site): properly track page view in hubspot
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Sep 11, 2023
1 parent e0404a2 commit cf6b6c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/hubspot.client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('page:finish', () => {
const route = useRoute()

let _hsq = window._hsq = window._hsq || [];
_hsq.push(['setPath', route.path]);
_hsq.push(['trackPageView']);

if (window?.HubSpotConversations?.widget) {
window.HubSpotConversations.widget.refresh()
}
Expand Down

1 comment on commit cf6b6c0

@vercel
Copy link

@vercel vercel bot commented on cf6b6c0 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kestra-io – ./

kestra-io.vercel.app
kestra-io-git-main-kestra.vercel.app
kestra-io-kestra.vercel.app

Please sign in to comment.