Skip to content

Commit

Permalink
swap google analytics with Plausible #230
Browse files Browse the repository at this point in the history
Custom tracking left out.
  • Loading branch information
mef committed Feb 2, 2023
1 parent c6b7755 commit f15b5bc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
12 changes: 8 additions & 4 deletions dynamic/client.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
var io = require('socket.io-client')
, Contact = require('./controller/contact-client')
, GaCustom = require('./controller/ga-custom')
//~, GaCustom = require('./controller/ga-custom')

let app = {}

app.io = io

app.gaCustom = new GaCustom()
//~app.gaCustom = new GaCustom()

app.gaCustom.init()
//~app.gaCustom.init()

window.gaCustom = app.gaCustom
//~window.gaCustom = app.gaCustom

app.gaCustom = {
toGa: function() { void 0 }
}

if (['/contact/', '/tools/csv-to-json/'].includes(window.location.pathname))
app.contact = new Contact(app)
24 changes: 12 additions & 12 deletions dynamic/controller/analytics-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,18 @@ function AnalyticsApi(gapi, callback, updateFunction) {

debug('signing user in')

gaCustom.toGa('event', {
category: 'multiga'
, action: 'sign in attempt'
})
//~gaCustom.toGa('event', {
//~category: 'multiga'
//~, action: 'sign in attempt'
//~})

gapi.auth2.getAuthInstance().signIn().then( function(res) {
// TODO handle errors at sign-in

gaCustom.toGa('event', {
category: 'multiga'
, action: 'user signed in'
})
//~gaCustom.toGa('event', {
//~category: 'multiga'
//~, action: 'user signed in'
//~})

callback()
})
Expand All @@ -187,10 +187,10 @@ function AnalyticsApi(gapi, callback, updateFunction) {
gapi.auth2.getAuthInstance().signOut().then( function(res) {
// TODO handle errors at sign-out

gaCustom.toGa('event', {
category: 'multiga'
, action: 'user signed out'
})
//~gaCustom.toGa('event', {
//~category: 'multiga'
//~, action: 'user signed out'
//~})

callback()
})
Expand Down
8 changes: 4 additions & 4 deletions dynamic/g-realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ app.controller.switchAccount = function(ix) {

app.controller.analyticsApi.getStats(app.data.viewsByAccount[ix])

gaCustom.toGa('event', {
category: 'multiga'
, action: 'switch account'
})
//~gaCustom.toGa('event', {
//~category: 'multiga'
//~, action: 'switch account'
//~})

}

Expand Down
2 changes: 1 addition & 1 deletion skeleton-framework
2 changes: 1 addition & 1 deletion source/css/skeleton.min.css

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions themes/mango-information-systems/layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
<![endif]-->

<% if (config.url !== 'http://mango-is.com' && config.url !== 'https://mango-is.com'){ %>
<% if (config.url !== 'http://alef.website' && config.url !== 'https://alef.website'){ %>
<meta name="robots" content="noindex, nofollow">
<% } %>

Expand Down Expand Up @@ -73,6 +73,7 @@
<%- feed_tag('/blog/atom.xml', {title: 'Mango Information Systems blog'}) %>
<% } %>

<%- partial('google-analytics') %>
<script defer data-domain="alef.website" src="https://pl.alef.website/js/pl.js"></script>
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>

</head>

0 comments on commit f15b5bc

Please sign in to comment.