Giter Site home page Giter Site logo

hutsoninc / gatsby-plugin-hubspot Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 15.0 850 KB

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

JavaScript 100.00%
gatsby gatsby-plugin hubspot

gatsby-plugin-hubspot's People

Contributors

austinleegordon avatar bodyno avatar davidthor avatar dependabot-preview[bot] avatar nikolaik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gatsby-plugin-hubspot's Issues

Window is not defined error

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?

Question: Can you specify pages to ignore

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.

Plugin calls setPath and overrides referrer (causing problems for source attribution)

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

js.hsforms.net wasn't loaded

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

Incompatible with Gatsby v5

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"
  },

plugin stopped working

Description

gatsby-plugin-hubspot doesn't work with latest gatsby

Steps to reproduce

enable the plugin, and an error prevents gatsby to finish the build

Support React 18

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.