【问题标题】:Gridsome & hubspot page tracker integrationGridsome 和 hubspot 页面跟踪器集成
【发布时间】:2020-08-17 10:29:53
【问题描述】:

我是一名初级开发人员,最近开始接待客户。有人要求我将我创建的他们当前的网站与 hubspot 页面跟踪器集成。

我在他们的开发者页面上查看过,它没有为 gridsome 而不是整个 SPA 提供具体说明。

我不知道在哪里嵌入提供的代码。

https://developers.hubspot.com/docs/api-/events/tracking-code

我的应用程序是一个 SPA,我正在使用 gridsome。

我的项目可以在https://github.com/chs242/ezras-nashim找到

我很迷茫。如果有人能花时间提供一点帮助,我将非常感激

问候

【问题讨论】:

  • 请阅读标签api的标题。

标签: api vue.js content-management-system hubspot gridsome


【解决方案1】:

要嵌入代码,请在 src/main.js 中添加 HubSpot 脚本(将 xxxxxxx 替换为您的 HubId):

export default function (Vue, { router, head, isClient }) {
  Vue.component('Layout', DefaultLayout)

  head.script.push({
    src: 'https://js.hs-scripts.com/xxxxxxx.js',
    body: true
  })
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-25
    • 1970-01-01
    • 2020-08-06
    相关资源
    最近更新 更多