Add seperate analytics config for universal links
This commit is contained in:
parent
1cf87f6681
commit
db8a4e9db8
@ -42,6 +42,10 @@ GOOGLE_SAFE_BROWSING_KEY=
|
||||
# Example: UA-XXXX-XX
|
||||
GOOGLE_ANALYTICS=
|
||||
|
||||
# Google Analytics tracking ID for universal analytics
|
||||
# This one is used for links
|
||||
# GOOGLE_ANALYRICS_UNIVERSAL=
|
||||
|
||||
# Your email host details to use to send verification emails.
|
||||
# More info on http://nodemailer.com/
|
||||
# Mail from example "Kutt <support@kutt.it>". Leave empty to use MAIL_USER
|
||||
|
@ -38,6 +38,10 @@ GOOGLE_SAFE_BROWSING_KEY={{GOOGLE_SAFE_BROWSING_KEY}}
|
||||
# Example: UA-XXXX-XX
|
||||
GOOGLE_ANALYTICS={{GOOGLE_ANALYTICS}}
|
||||
|
||||
# Google Analytics tracking ID for universal analytics
|
||||
# This one is used for links
|
||||
GOOGLE_ANALYRICS_UNIVERSAL={{GOOGLE_ANALYRICS_UNIVERSAL}}
|
||||
|
||||
# Your email host details to use to send verification emails.
|
||||
# More info on http://nodemailer.com/
|
||||
# Mail from example "Kutt <support@kutt.it>". Leave empty to use MAIL_USER
|
||||
|
@ -27,7 +27,8 @@ if (hasServerConfig && hasClientConfig) {
|
||||
RECAPTCHA_SITE_KEY: clientConfig.RECAPTCHA_SITE_KEY,
|
||||
RECAPTCHA_SECRET_KEY: serverConfig.RECAPTCHA_SECRET_KEY,
|
||||
GOOGLE_SAFE_BROWSING_KEY: serverConfig.GOOGLE_SAFE_BROWSING_KEY,
|
||||
GOOGLE_ANALYTICS: serverConfig.GOOGLE_ANALYTICS || clientConfig.GOOGLE_ANALYTICS,
|
||||
GOOGLE_ANALYTICS: clientConfig.GOOGLE_ANALYTICS_ID,
|
||||
GOOGLE_ANALYTICS_UNIVERSAL: serverConfig.GOOGLE_ANALYTICS,
|
||||
MAIL_HOST: serverConfig.MAIL_HOST,
|
||||
MAIL_PORT: serverConfig.MAIL_PORT,
|
||||
MAIL_SECURE: serverConfig.MAIL_SECURE,
|
||||
|
@ -188,8 +188,8 @@ exports.goToUrl = async (req, res, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
if (process.env.GOOGLE_ANALYTICS && !isBot) {
|
||||
const visitor = ua(process.env.GOOGLE_ANALYTICS);
|
||||
if (process.env.GOOGLE_ANALYTICS_UNIVERSAL && !isBot) {
|
||||
const visitor = ua(process.env.GOOGLE_ANALYTICS_UNIVERSAL);
|
||||
visitor
|
||||
.pageview({
|
||||
dp: `/${id}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user