You've already forked AstralRinth
forked from didirus/AstralRinth
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:
@@ -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
20
middleware/analytics.js
Normal 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.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user