Coder Social home page Coder Social logo

gatsby-plugin-hotjar's Introduction

gatsby-plugin-hotjar

Easily add Hotjar Analytics to your Gatsby site.

Install

yarn add gatsby-plugin-hotjar

or

npm i gatsby-plugin-hotjar --save

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-hotjar`,
    options: {
      includeInDevelopment: true, // optional parameter to include script in development
      id: YOUR_HOTJAR_ID,
      sv: YOUR_HOTJAR_SNIPPET_VERSION,
    },
  },
];

To find your Hotjar ID, click the Tracking code button for your site. The Hotjar Snippet Version is in the tracking code, look for a line like:

h._hjSettings={hjid:[hotjar id],hjsv:6};

The version is the value of hjsv.

gatsby-plugin-hotjar's People

Contributors

dependabot[bot] avatar pavloko avatar woutersioen avatar

Stargazers

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

Watchers

 avatar  avatar

gatsby-plugin-hotjar's Issues

Licensing and forks

Hello there!

The gatsby-plugin-hotjar plugin still works nicely. But it does not provide any option to supply some custom data to comply with CMPs that do not feature automated blocking.
I want to create a fork lazybytez/gatsby-plugin-klaro-hotjar to support KIProtect Klaro, but I just saw that there is no license in the repository. As you can read in GitHub's ToS a repository without
a license can be read and forked, but it is not allowed to modify the source code or create alternative releases
.

As I want to add the code necessary to use the plugin and publish the package for others to use on npm, it would be great if you might add some license that allows to fork, edit and publish the project (under a name like gatsby-plugin-klaro-hotjar). The original plugin will surely be linked in the description at the top of the README.md.

Giving error when adding code snippet

error We encountered an error while trying to load your site's gatsby-config. Please fix the error and try again.

Error: C:\work files\websites\codebase_website\gatsby-config.js:41
sv: <script>
^
SyntaxError: Unexpected token <

  • v8-compile-cache.js:226 NativeCompileCache._moduleCompile
    [codebase_website]/[v8-compile-cache]/v8-compile-cache.js:226:18

  • v8-compile-cache.js:172 Module._compile
    [codebase_website]/[v8-compile-cache]/v8-compile-cache.js:172:36

  • loader.js:712 Object.Module._extensions..js
    internal/modules/cjs/loader.js:712:10

  • loader.js:600 Module.load
    internal/modules/cjs/loader.js:600:32

  • loader.js:539 tryModuleLoad
    internal/modules/cjs/loader.js:539:12

  • loader.js:531 Function.Module._load
    internal/modules/cjs/loader.js:531:3

  • loader.js:637 Module.require
    internal/modules/cjs/loader.js:637:17

  • v8-compile-cache.js:159 require
    [codebase_website]/[v8-compile-cache]/v8-compile-cache.js:159:20

  • get-config-file.js:26 getConfigFile
    [codebase_website]/[gatsby]/dist/bootstrap/get-config-file.js:26:20

  • index.js:96 module.exports
    [codebase_website]/[gatsby]/dist/bootstrap/index.js:96:36

  • build.js:75 build
    [codebase_website]/[gatsby]/dist/commands/build.js:75:13

  • create-cli.js:173 cli.command.handler.getCommandHandler
    [npm]/[gatsby-cli]/lib/create-cli.js:173:14

  • create-cli.js:108 argv
    [npm]/[gatsby-cli]/lib/create-cli.js:108:24

  • create-cli.js:25 Object.args [as handler]
    [npm]/[gatsby-cli]/lib/create-cli.js:25:19

  • command.js:238 Object.runCommand
    [npm]/[gatsby-cli]/[yargs]/lib/command.js:238:44

How to record custom Event?

Hi

Is there a way to record a custom Hotjar event with this script?

From their docs:

	.addEventListener('click', () => hj('event', 'clicked_cta'));

But I can't get a reference to hj. Any ideas?

T

Allow increasing cache TTL

Doing a light house audit of our website, the following appeared:

Screenshot 2021-02-15 at 20 31 29

I'm assuming this library could help configure it better?

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.