Switch ads provider, and switch the analytics system to Ariadne (#214)

* Switch ads provider, and switch the analytics system to Ariadne

* Fix CI error

* Remove debug messages and errors

* Updated nuxtjs
This commit is contained in:
Redblueflame
2021-05-18 16:48:26 +02:00
committed by GitHub
parent c97cba69b9
commit 12d86493bf
12 changed files with 8695 additions and 9400 deletions

View File

@@ -1,8 +0,0 @@
/* eslint-disable no-undef */
export default function ({ route }) {
if (process.client) {
googletag.cmd.push(function () {
googletag.pubads().setTargeting('path', route.path)
})
}
}

20
middleware/analytics.js Normal file
View File

@@ -0,0 +1,20 @@
import axios from 'axios'
export default async function (context) {
let domain = ''
if (process.server) {
domain = context.req.headers.host
} else {
domain = location.host
}
const url = context.$config.analytics.base_url + '/register/visit'
const path = context.route.path.split('?')[0]
try {
return await axios.post(url, {
path,
domain,
consent: false,
})
} catch (e) {
// Simply silence the issue.
}
}