diff --git a/.gitignore b/.gitignore
index 1f55fbcc..328890cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,7 +15,7 @@
# production
/build
-/public/umami.js
+/public/barista.js
/public/geo
/public/lang
/lang-compiled
diff --git a/components/forms/TrackingCodeForm.js b/components/forms/TrackingCodeForm.js
index fd679ab2..19cabc6d 100644
--- a/components/forms/TrackingCodeForm.js
+++ b/components/forms/TrackingCodeForm.js
@@ -24,7 +24,7 @@ export default function TrackingCodeForm({ values, onClose }) {
rows={3}
cols={60}
spellCheck={false}
- defaultValue={``}
+ defaultValue={``}
readOnly
/>
diff --git a/components/pages/TestConsole.js b/components/pages/TestConsole.js
index b715b4a8..3818a0fa 100644
--- a/components/pages/TestConsole.js
+++ b/components/pages/TestConsole.js
@@ -39,7 +39,7 @@ export default function TestConsole() {
{typeof window !== 'undefined' && website && (
-
+
)}
diff --git a/next.config.js b/next.config.js
index 894db681..2d2d605e 100644
--- a/next.config.js
+++ b/next.config.js
@@ -19,7 +19,7 @@ module.exports = {
async headers() {
return [
{
- source: '/umami.js',
+ source: '/barista.js',
headers: [
{
key: 'Cache-Control',
diff --git a/rollup.tracker.config.js b/rollup.tracker.config.js
index 5d2938ee..cea4111e 100644
--- a/rollup.tracker.config.js
+++ b/rollup.tracker.config.js
@@ -6,7 +6,7 @@ import { terser } from 'rollup-plugin-terser';
export default {
input: 'tracker/index.js',
output: {
- file: 'public/umami.js',
+ file: 'public/barista.js',
format: 'iife',
},
plugins: [resolve(), buble({ objectAssign: true }), terser({ compress: { evaluate: false } })],
diff --git a/tracker/index.js b/tracker/index.js
index 04266a68..efcf8671 100644
--- a/tracker/index.js
+++ b/tracker/index.js
@@ -25,7 +25,7 @@ import { removeTrailingSlash } from '../lib/url';
const domains = attr('data-domains');
const disableTracking =
- localStorage.getItem('umami.disabled') ||
+ localStorage.getItem('cappuccino.disabled') ||
(dnt && doNotTrack()) ||
(domains &&
!domains
@@ -39,7 +39,7 @@ import { removeTrailingSlash } from '../lib/url';
const screen = `${width}x${height}`;
const listeners = [];
let currentUrl = `${pathname}${search}`;
- let currentRef = document.referrer;
+ let currentRef = document.referrer || new URLSearchParams(window.location.search).get('r');
/* Collect metrics */
@@ -60,7 +60,7 @@ import { removeTrailingSlash } from '../lib/url';
const collect = (type, params, uuid) => {
if (disableTracking) return;
- const key = 'umami.cache';
+ const key = 'cappuccino.cache';
const payload = {
website: uuid,
@@ -110,9 +110,9 @@ import { removeTrailingSlash } from '../lib/url';
/* Handle events */
const addEvents = () => {
- document.querySelectorAll("[class*='umami--']").forEach(element => {
+ document.querySelectorAll("[class*='cappuccino--']").forEach(element => {
element.className.split(' ').forEach(className => {
- if (/^umami--([a-z]+)--([\w]+[\w-]*)$/.test(className)) {
+ if (/^cappuccino--([a-z]+)--([\w]+[\w-]*)$/.test(className)) {
const [, type, value] = className.split('--');
const listener = () => trackEvent(value, type);
@@ -155,14 +155,14 @@ import { removeTrailingSlash } from '../lib/url';
/* Global */
- if (!window.umami) {
- const umami = event_value => trackEvent(event_value);
- umami.trackView = trackView;
- umami.trackEvent = trackEvent;
- umami.addEvents = addEvents;
- umami.removeEvents = removeEvents;
+ if (!window.cappuccino) {
+ const cappuccino = event_value => trackEvent(event_value);
+ cappuccino.trackView = trackView;
+ cappuccino.trackEvent = trackEvent;
+ cappuccino.addEvents = addEvents;
+ cappuccino.removeEvents = removeEvents;
- window.umami = umami;
+ window.cappuccino = cappuccino;
}
/* Start */