From b01b7c0c065b2f8965d946c1cc0f81f7f47c4a0f Mon Sep 17 00:00:00 2001 From: Peter Spicer Date: Thu, 9 Jan 2020 13:03:54 +0000 Subject: [PATCH] Also inject analytics with headers, not just in footer The current before_footer hook works great for Google Analytics, but isn't 100% consistent for Piwik as usually the page has often rendered the header by that time. Change-Id: Ifac6917818e33db022e1a5522a58b229a9e3e369 --- lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib.php b/lib.php index facebdd..bb4dfb4 100644 --- a/lib.php +++ b/lib.php @@ -37,3 +37,11 @@ function local_analytics_before_footer() { injector::inject(); } + +/** + * Output callback, available since Moodle 3.3 + * + */ +function local_analytics_before_http_headers() { + injector::inject(); +} \ No newline at end of file