hutsoninc / gatsby-plugin-hubspot Goto Github PK
View Code? Open in Web Editor NEWA Gatsby plugin to easily add a HubSpot embed code to your site.
Home Page: https://www.npmjs.com/package/gatsby-plugin-hubspot
License: MIT License
A Gatsby plugin to easily add a HubSpot embed code to your site.
Home Page: https://www.npmjs.com/package/gatsby-plugin-hubspot
License: MIT License
After running 'gatsby build' with clean .cache and public/ folder, I'm getting this error:
error Building static HTML failed for path "/offline-plugin-app-shell-fallback/"
See our docs page on debugging HTML builds for help https://gatsby.app/debug-html
24 | }
25 |
> 26 | if (window.doNotTrack || navigator.doNotTrack || navigator.msDoNotTrack || 'msTrackingProtectionEnabled' in window.external) {
| ^
27 | if (window.doNotTrack == "1" || navigator.doNotTrack == "yes" || navigator.doNotTrack == "1" || navigator.msDoNotTrack == "1" || window.external.msTrackingProtectionEnabled()) {
28 | _hsq.push(['doNotTrack']);
29 | }
WebpackError: ReferenceError: window is not defined
- gatsby-ssr.js:26 Object.onRenderBody
[lib]/[gatsby-plugin-hubspot]/gatsby-ssr.js:26:1
- api-runner-ssr.js:40
lib/.cache/api-runner-ssr.js:40:39
- api-runner-ssr.js:36 ./.cache/api-runner-ssr.js.module.exports
lib/.cache/api-runner-ssr.js:36:25
- static-entry.js:249 Module../.cache/static-entry.js.__webpack_exports__.default
lib/.cache/static-entry.js:249:3
- bootstrap:24 Promise
lib/webpack/bootstrap:24:1
- gatsby-browser-entry.js:26 Promise._resolveFromExecutor
lib/.cache/gatsby-browser-entry.js:26:16
- bootstrap:68 new Promise
lib/webpack/bootstrap:68:1
- bootstrap:5 tryCatcher
lib/webpack/bootstrap:5:1
- bootstrap:50 MappingPromiseArray._promiseFulfilled
lib/webpack/bootstrap:50:1
- api-runner-ssr.js:6 MappingPromiseArray.PromiseArray._iterate
lib/.cache/api-runner-ssr.js:6:16
- bootstrap:67 MappingPromiseArray.init
lib/webpack/bootstrap:67:1
- bootstrap:19 MappingPromiseArray._asyncInit
lib/webpack/bootstrap:19:1
- api-runner-ssr.js:22 _drainQueueStep
lib/.cache/api-runner-ssr.js:22:1
Is there any workaround you're aware of for this issue?
There are probably a number of ways to do this but the main thing I'm trying to resolve is the ability to not track a few pages. The pages have forms on them for internal use and it seems to be creating a lead in hubspot that I don't want.
The end question is if there is a way to say:
Ignore pages: /training, /support-messaging
It doesn't seem like the plugin supports this functionality and I may need to roll my own solution. I thought I'd ask just to make sure.
Hi,
We've been using this plugin to integrate with hubspot. However, we noticed that Hubspot was incorrectly attributing the source for new contacts (it would always be listed as direct). For example, if a new user visited our website using a link and then filled out a form later on in the session, Hubspot would list the form submission as direct traffic (this also happens with the creation source for the contact).
We contacted Hubspot support and they told us that "the setPath function on your site is overriding the current page URL and referrer, and thus the source of the contact."
We were told to remove the calls to setPath. However, we are never calling this function.
I am wondering if this is an issue that other people have experienced? Do you know of any fixes that we could try to fix this behavior? We have already tried installing the code manually instead of the plugin which did not change anything.
The files are hosted on s3.
Thanks
Hi.
I've installed the plugin today but js.hsforms.net
script wasn't loaded at all when I check on network tab.
Here is my gatsby-config.
require("dotenv").config();
module.exports = {
plugins: [
{
resolve: "gatsby-plugin-hubspot",
options: {
trackingCode: process.env.HUBSPOT_PORTAL_ID,
},
},
`gatsby-plugin-emotion`,
`gatsby-plugin-no-sourcemaps`,
`gatsby-plugin-react-helmet`,
`gatsby-plugin-catch-links`,
`gatsby-plugin-sass`,
`gatsby-plugin-typescript`,
`gatsby-plugin-meta-redirect`,
{
resolve: `gatsby-plugin-sitemap`,
options: {
exclude: [`/ironcore-cmk/*`],
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `src`,
path: `${__dirname}/src/`,
},
},
{
resolve: `gatsby-transformer-remark`,
options: {
classPrefix: `language-js`,
plugins: [`gatsby-remark-prismjs`, `gatsby-remark-external-links`],
},
},
{
resolve: "gatsby-source-graphql",
options: {
typeName: "TS",
fieldName: "takeshape",
url: `https://api.takeshape.io/project/${process.env.TAKESHAPE_PROJECT}/graphql`,
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.TAKESHAPE_TOKEN}`,
},
fetchOptions: {},
},
}
],
};
Any thoughts on this?
Thanks
See https://github.com/hutsoninc/gatsby-plugin-hubspot/blob/master/src/gatsby-ssr.js#L5
As per https://www.gatsbyjs.org/docs/ssr-apis/#onRenderBody there is no reporter
available.
This causes following error on this line when HubSpot tracking code is not defined:
WebpackError: TypeError: Cannot read property 'warn' of undefined
The peer dependencies are incompatible with the latest major version of Gatsby (which itself requires react ^18).
"peerDependencies": {
"gatsby": "^4.0.0-next",
"react": "^16.9.0 || ^17.0.0",
"react-dom": "^16.9.0 || ^17.0.0"
},
gatsby-plugin-hubspot
doesn't work with latest gatsby
enable the plugin, and an error prevents gatsby to finish the build
I've updated my homepage project and noticed this message:
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"18.2.0" from the root project
npm ERR! peer react@"^16.9.0 || ^17.0.0 || ^18.0.0" from [email protected]
npm ERR! node_modules/gatsby
npm ERR! gatsby@"4.17.2" from the root project
npm ERR! peer gatsby@"^4.0.0-next" from [email protected]
npm ERR! node_modules/gatsby-plugin-hubspot
npm ERR! gatsby-plugin-hubspot@"2.0.0" from the root project
npm ERR! 1 more (react-dom)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.9.0 || ^17.0.0" from [email protected]
npm ERR! node_modules/gatsby-plugin-hubspot
npm ERR! gatsby-plugin-hubspot@"2.0.0" from the root project
Please add support for React 18
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.