From 7aa2c1f904ed01dd0e4cc19985eb8d5664ff92d5 Mon Sep 17 00:00:00 2001 From: Shukry Zablah Date: Sun, 28 Feb 2021 20:29:58 -0500 Subject: [PATCH] create gtag plugin, same as analytics, but updated --- plugins/gtag.lisp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 plugins/gtag.lisp diff --git a/plugins/gtag.lisp b/plugins/gtag.lisp new file mode 100644 index 0000000..06e59e1 --- /dev/null +++ b/plugins/gtag.lisp @@ -0,0 +1,21 @@ +(defpackage :coleslaw-gtag + (:use :cl) + (:export #:enable) + (:import-from :coleslaw #:add-injection)) + +(in-package :coleslaw-gtag) + +(defvar *analytics-js* +" + +") + +(defun enable (&key tracking-code) + (let ((snippet (format nil *analytics-js* tracking-code tracking-code))) + (add-injection (constantly snippet) :head)))