Merge pull request #180 from doricci/HotJar

Added Hotjar service
This commit is contained in:
Amauri CHAMPEAUX 2018-10-08 08:20:59 +02:00 committed by GitHub
commit 6db6a87c9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 0 deletions

View File

@ -2341,6 +2341,41 @@ tarteaucitron.services.matomo = {
}
};
// Hotjar
/*
1. Set the following variable before the initialization :
tarteaucitron.user.hotjarId = YOUR_WEBSITE_ID;
tarteaucitron.user.HotjarSv = XXXX; // Can be found in your website tracking code as "hjvs=XXXX"
2. Push the service :
(tarteaucitron.job = tarteaucitron.job || []).push('hotjar');
3. HTML
You don't need to add any html code, if the service is autorized, the javascript is added. otherwise no.
*/
tarteaucitron.services.hotjar = {
"key": "hotjar",
"type": "analytic",
"name": "Hotjar",
"uri": "https://help.hotjar.com/hc/en-us/categories/115001323967-About-Hotjar",
"needConsent": true,
"cookies": ["hjClosedSurveyInvites", "_hjDonePolls", "_hjMinimizedPolls", "_hjDoneTestersWidgets", "_hjMinimizedTestersWidgets", "_hjDoneSurveys", "_hjIncludedInSample", "_hjShownFeedbackMessage"],
"js": function () {
"use strict";
if (tarteaucitron.user.hotjarId === undefined || tarteaucitron.user.HotjarSv === undefined) {
return;
}
window.hj = window.hj || function() {
(window.hj.q = window.hj.q || []).push(arguments)
};
window._hjSettings = {
hjid: tarteaucitron.user.hotjarId,
hjsv: tarteaucitron.user.HotjarSv
};
var uri = 'https://static.hotjar.com/c/hotjar-';
var extension = '.js?sv=';
tarteaucitron.addScript(uri + window._hjSettings.hjid + extension + window._hjSettings.hjsv);
}
};
// bing ads universal event tracking
tarteaucitron.services.bingads = {
'key': 'bingads',