Skip to content

Commit

Permalink
Add hotjar (#395)
Browse files Browse the repository at this point in the history
* add hotjar

* external stylesheet
  • Loading branch information
annarhughes committed Oct 31, 2023
1 parent c9afb2c commit da7501a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/views/application/_head.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<link href="https://fonts.googleapis.com/css?family=Nunito:300,300i,400,400i,700,700i&display=swap" rel="stylesheet">

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link href="https://bloom.chayn.co/hotjarNPS.css" rel="stylesheet" type="text/css" />
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
</head>
14 changes: 10 additions & 4 deletions app/webpack/packs/application.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import '../stylesheets/application.scss';

import Rails from '@rails/ujs';
import Turbolinks from 'turbolinks';
import 'bootstrap/dist/js/bootstrap';
import 'bootstrap-select';
import 'bootstrap/dist/js/bootstrap';
import 'data-confirm-modal';
import Turbolinks from 'turbolinks';

import Vue from 'vue/dist/vue.esm';
import TurbolinksAdapter from 'vue-turbolinks';
import Vue from 'vue/dist/vue.esm';

import Hotjar from '@hotjar/browser';
import SignIn from '../components/authentication/sign_in.vue';
import Profile from '../components/user_profile/profile.vue';
import CookieLaw from '../components/cookie_law/cookie_law.vue';
import LeaveSite from '../components/leave_site/leave_site.vue';
import Profile from '../components/user_profile/profile.vue';

Rails.start();
Turbolinks.start();
Expand All @@ -21,6 +22,11 @@ Vue.use(TurbolinksAdapter);

import '../vue-rollbar.js.erb'; // eslint-disable-line import/first

const siteId = process.env.HOTJAR_ID;
const hotjarVersion = 6;

Hotjar.init(siteId, hotjarVersion);

document.addEventListener('turbolinks:load', () => {
const components = [
{
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@babel/plugin-transform-runtime": "7",
"@babel/preset-env": "7",
"@babel/runtime": "7",
"@hotjar/browser": "^1.0.9",
"@rails/ujs": "7.0.8",
"axios": "^1.4.0",
"babel-loader": "8",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,11 @@
protobufjs "^7.2.4"
yargs "^17.7.2"

"@hotjar/browser@^1.0.9":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@hotjar/browser/-/browser-1.0.9.tgz#769b4ded3fa7b9557b785c107f0cd76d3f83789a"
integrity sha512-n9akDMod8BLGpYEQCrHwlYWWd63c1HlhUSXNIDfClZtKYXbUjIUOFlNZNNcUxgHTCsi4l2i+SWKsGsO0t93S8w==

"@humanwhocodes/config-array@^0.11.10":
version "0.11.10"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2"
Expand Down

0 comments on commit da7501a

Please sign in to comment.