[ads] switch to adsense

This commit is contained in:
Andrea Vos 2022-12-29 15:36:18 +01:00
parent d879b07785
commit 11b79d08c7
17 changed files with 100 additions and 194 deletions

View File

@ -1,8 +1,13 @@
<template>
<div v-if="config.ads && config.ads.enabled"
:id="`ezoic-pub-ad-placeholder-${phid}`"
:class="[adPlaceholdersVisible ? 'ad-placeholder' : '']"
v-html="adPlaceholdersVisible ? `${phkey} / ${phid}` : ''">
<div v-if="config.ads && config.ads.enabled && active"
:class="[adPlaceholdersVisible ? 'ad-placeholder' : '']">
<span v-if="adPlaceholdersVisible">{{phkey}} / {{adConfig.slotId}}</span>
<ins v-else class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-8518361481036191"
:data-ad-slot="adConfig.slotId"
:data-ad-format="adConfig.adFormat"
:data-full-width-responsive="adConfig.responsive ? 'true' : ''"></ins>
</div>
</template>
@ -15,8 +20,18 @@ export default {
phkey: {required: true},
},
data() {
if (!adPlaceholders[this.phkey]) {
return { active: false, adConfig: {} };
}
const [slotId, adFormat, responsive] = adPlaceholders[this.phkey];
return {
phid: adPlaceholders[this.phkey],
active: true,
adConfig: {
slotId,
adFormat,
responsive,
}
}
},
computed: {

View File

@ -1,145 +0,0 @@
<template>
<div v-if="visible" class="cc-modal">
<div :class="['cc-modal-bg', blur ? 'd-block' : '']"></div>
<div class="cc-modal-box bg-white border-top border-primary small">
<div class="container py-3">
<p class="d-flex justify-content-between">
<span class="h5">
<T>privacy.consent.header</T>
</span>
</p>
<div class="d-flex flex-column flex-lg-row">
<div>
<p class="h6"><T>privacy.consent.required.header</T></p>
<p class="mb-1"><T>privacy.consent.required.description</T></p>
<p><T>privacy.consent.required.details</T></p>
</div>
<div>
<p class="h6"><T>privacy.consent.optional.header</T></p>
<p class="mb-1"><T>privacy.consent.optional.description</T></p>
<p><T>privacy.consent.optional.details</T></p>
</div>
<div class="d-flex flex-column m-2">
<div class="d-flex flex-row flex-lg-column justify-content-center">
<button class="btn btn-primary m-1 text-nowrap" @click="setConsent(true)">
<Icon v="check"/>
<T>privacy.consent.accept</T>
</button>
<button class="btn btn-primary m-1 text-nowrap" @click="setConsent(false)">
<Icon v="times"/>
<T>privacy.consent.reject</T>
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import adPlaceholders from "../src/adPlaceholders";
export default {
data() {
return {
consent: this.$cookies.get('cookie-consent'),
ezstandalone: undefined,
}
},
async mounted() {
if (!this.enabled || !process.client) { return; }
await this.$loadScript('ezstandalone', `https://www.ezojs.com/ezoic/sa.min.js`);
await this.$loadScript('adsense', `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8518361481036191`);
this.enableAds();
},
computed: {
enabled() {
return this.config.ads?.enabled && process.env.NODE_ENV !== 'development';
},
visible() {
return this.enabled && this.consent === undefined;
},
blur() {
if (!this.enabled) { return false; }
if ([this.config.user.privacyRoute, this.config.user.termsRoute, 'why-ads'].includes(this.$route.path.substr(1))) {
return false;
}
return true;
},
},
methods: {
setConsent(v) {
this.consent = v;
this.$cookies.set('cookie-consent', v, {expires: new Date(+new Date + 365*24*60*60*1000)});
this.enableAds();
},
enableAds() {
if (this.consent === undefined) { return; }
if (this.$isGranted()) {
const adsVisible = parseInt(localStorage.getItem('adsVisible') || '0') === 1;
if (!adsVisible) {
return;
}
}
window._ezAllowed = (tcdata, purpose) => {
return !!this.consent;
}
this.ezstandalone = window.ezstandalone || {};
ezstandalone.cmd = ezstandalone.cmd || [];
ezstandalone.cmd.push(() => {
ezstandalone.setIsPWA();
ezstandalone.setDisablePersonalizedStatistics(!this.consent);
ezstandalone.setDisablePersonalizedAds(!this.consent);
if (typeof ezConsentCategories === 'object' && typeof __ezconsent === 'object') {
window.ezConsentCategories.preferences = this.consent;
window.ezConsentCategories.statistics = this.consent;
window.ezConsentCategories.marketing = this.consent;
__ezconsent.setEzoicConsentSettings(window.ezConsentCategories);
}
ezstandalone.define(Object.values(adPlaceholders));
ezstandalone.enable();
ezstandalone.display();
});
},
},
watch: {
$route(to, from) {
if (this.ezstandalone) {
this.ezstandalone.refresh();
}
},
}
}
</script>
<style lang="scss">
@import "assets/variables";
.cc-modal-box {
position: fixed;
bottom: 0;
left: 0;
right: 0;
width: 100%;
z-index: 100002;
box-shadow: 0 -.5rem 1rem rgba($black, .15);
}
.cc-modal-bg {
position: fixed;
top: 0;
left: 0;
z-index: 1055;
display: none;
width: 100%;
height: 100%;
overflow-x: hidden;
overflow-y: auto;
outline: 0;
}
</style>

View File

@ -9,7 +9,6 @@
<Footer/>
<DialogueBox ref="dialogue"/>
<Lightbox/>
<CookieConsent/>
</div>
</template>
@ -62,6 +61,8 @@
sorter();
this.confirmAge();
this.loadAds();
},
methods: {
async confirmAge() {
@ -75,8 +76,27 @@
await this.$alert(this.$t('footer.ageLimit'));
localStorage.setItem('ageConfirmed', '1');
},
async loadAds() {
if (!this.adsEnabled) { return; }
await this.$loadScript('adsense', `https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-8518361481036191`);
(window.adsbygoogle = window.adsbygoogle || []).push({});
}
},
computed: {
adsEnabled() {
if (this.$isGranted()) {
const adsVisible = parseInt(localStorage.getItem('adsVisible') || '0') === 1;
if (!adsVisible) {
return false;
}
}
return this.config.ads?.enabled && process.env.NODE_ENV !== 'development';
},
},
}
</script>

View File

@ -803,6 +803,7 @@ terms:
These Terms of Service govern your access to and use of the Service provided on the website
<strong>pronouns.page</strong> and related subdomains and domains,
operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
consent: >
By using the Services you agree to be bound by these Terms of Service and you consent
@ -892,6 +893,7 @@ privacy:
<strong>pronouns.page</strong> and related subdomains and domains
manages your personal data.
The Service is operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
effort: >
We make every effort to store your data securely and to ensure that any non-public data we store
@ -943,7 +945,7 @@ privacy:
details: 'You can read more in Ezoic''s {https://g.ezoic.net/privacy/pronouns.page=Privacy Policy}.'
accept: 'Accept'
reject: 'Reject'
revoke: 'Reset cookie consent settings'
revoke: 'Revoke personalised ads consent'
admin:
header: 'Admin panel'

View File

@ -942,6 +942,7 @@ terms:
These Terms of Service govern your access to and use of the Service provided on the website
<strong>pronouns.page</strong> and related subdomains and domains,
operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
consent: >
By using the Services you agree to be bound by these Terms of Service and you consent
@ -1032,6 +1033,7 @@ privacy:
<strong>pronouns.page</strong> and related subdomains and domains
manages your personal data.
The Service is operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
effort: >
We make every effort to store your data securely and to ensure that any non-public data we store
@ -1057,10 +1059,12 @@ privacy:
We use <strong>hCaptcha</strong> to filter out bots and prevent attacks.
You can read their privacy policy
{https://www.hcaptcha.com/privacy=<strong>here</strong>}.
ezoic: >
In order to fund the project we show ads using a third party technology called <strong>Ezoic</strong>.
You can opt-in to allow them to personalise your experience.
Their privacy policy is available {https://g.ezoic.net/privacy/pronouns.page=<strong>here</strong>}.
adsense: >
In order to fund the project we show ads using third party vendors, including <strong>Google</strong>,
whose ads policy is available {https://support.google.com/adwordspolicy/answer/1316548=here}.
Google uses cookies that enable it to serve ads to our users based on previous visits to our site and other sites.
You may opt out of personalised advertising by not giving your consent when prompted,
by revoking your consent using a button below, or by visiting {https://adssettings.google.com/=Ads Settings}.
logsBackups: >
Logs and backups are stored for no longer than 18 months.
gdpr: >
@ -1083,7 +1087,7 @@ privacy:
details: 'You can read more in Ezoic''s {https://g.ezoic.net/privacy/pronouns.page=Privacy Policy}.'
accept: 'Accept'
reject: 'Reject'
revoke: 'Reset cookie consent settings'
revoke: 'Revoke personalised ads consent'
admin:
header: 'Admin panel'

View File

@ -714,6 +714,7 @@ terms:
intro: >
Estos Términos de Servicio rigen tu acceso y uso del Servicio provisto en el sitio web
<strong>pronouns.page / pronombr.es</strong> operado por la cooperativa “Consejo de Lenguaje Neutro”
y Nero Network (NL, KVK 88409120)
quienes pueden ser contactadxs mediante correo electrónico:
consent: >
Al usar los Servicios, aceptas estar sujetx a estos Términos de Servicio y otorgas consentimiento

View File

@ -714,6 +714,7 @@ terms:
intro: >
I presenti Termini di servizio regolano l'accesso e l'utilizzo del Servizio fornito sul sito web
<strong>pronouns.page</strong> gestito da “Neutral Language Council” collective
e Nero Network (NL, KVK 88409120)
che può essere contattato via e-mail:
consent: >
Utilizzando i Servizi accetti di essere vincolato da questi Termini di servizio e acconsenti
@ -794,6 +795,7 @@ privacy:
<strong>pronouns.page</strong> and related subdomains and domains
manages your personal data.
The Service is operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
effort: >
Ci sforziamo ad archiviare i tuoi dati in modo sicuro e garantire che tutti i tuoi dati non pubblici che conserviamo

View File

@ -672,6 +672,7 @@ terms:
intro: >
이 서비스 약관은 웹 사이트에서 제공되는 서비스에 대한 액세스 및 사용에 적용됩니다.
<strong>pronouns.page</strong> "중립 언어 위원회" 집단에서 운영
& Nero Network (NL, KVK 88409120)
이메일로 연락하기:
consent: >
서비스를 사용함으로써 귀하는 본 서비스 약관에 동의하고 동의합니다.
@ -753,6 +754,7 @@ privacy:
<strong>pronouns.page</strong> and related subdomains and domains
manages your personal data.
The Service is operated by the “Neutral Language Council” collective
and Nero Network (NL, KVK 88409120)
who can be contacted via email:
effort: >
We make every effort to store your data securely and to ensure that any non-public data we store

View File

@ -1596,8 +1596,9 @@ terms:
content:
intro: >
Poniższy Regulamin reguluje Twój dostęp do oraz warunki użytkowania Usług dostępnych poprzez stronę
<strong>pronouns.page / zaimki.pl</strong> administrowaną przez kolektyw „Rada Języka Neutralnego”,
z którym możesz skontaktować się drogą mailową:
<strong>pronouns.page / zaimki.pl</strong> administrowaną przez kolektyw „Rada Języka Neutralnego”
oraz Nero Network (NL, KVK 88409120),
z którymi możesz skontaktować się drogą mailową:
consent: >
Używając Usług wyrażasz zgodę na warunki Regulaminu
oraz na to, byśmy zbierały i przetwarzały Twoje dane zgodnie z naszą {/prywatnosc=Polityką Prywatności}.
@ -1680,8 +1681,9 @@ privacy:
intro: >
Poniższa Polityka Prywatności opisuje w jaki sposób Usługi dostępne poprzez stronę
<strong>pronouns.page / zaimki.pl</strong> zarządzają Twoimi danymi osobistymi.
Usługa administrowana jest przez kolektyw „Rada Języka Neutralnego”,
z którym możesz skontaktować się drogą mailową:
Usługa administrowana jest przez kolektyw „Rada Języka Neutralnego”
oraz Nero Network (NL, KVK 88409120),
z którymi możesz skontaktować się drogą mailową:
effort: >
Dokładamy wszelkich starań, by przechowywać Twoje dane w sposób bezpieczny,
oraz by wszystkie dane, których wprost nie opublikujesz, nie zostały przejęte przez osoby trzecie,

View File

@ -869,6 +869,7 @@ terms:
intro: >
Acești termeni conduc accesul și utilizarea ta al acestui serviciu, furnizate de către website-ul
<strong>pronouns.page</strong> operat de colectivul „Consiliul Limbajului Neutru”
& Nero Network (NL, KVK 88409120)
care poate fi contactat prin email:
consent: >
Prin folosirea serviciilor, ești de acord cu acești termeni și accepți

View File

@ -812,6 +812,7 @@ terms:
intro: >
Данные Условия предоставления услуг регулируют доступ к использованию сайта
<strong>pronouns.page</strong> под управлением коллектива "Совета нейтрального языка"
& Nero Network (NL, KVK 88409120)
с кем можно связаться через электронную почту:
consent: >
Используя предоставленные сервисы, вы даете свое согласие на соблюдение Условий предоставления услуг, а также на

View File

@ -681,6 +681,7 @@ terms:
intro: >
Dessa användarvillkor ger dig tillgång till och användningen till tjänsten på webbsidan.
<strong>pronouns.page</strong> sköts av det “Neutrala språkets råd”-kollektivet
& Nero Network (NL, KVK 88409120)
som kan kontaktas via mail:
consent: >
När du använder våra tjänster så godkänner du att du ska följa dessa användarvillkor och att du tillåter
@ -756,7 +757,9 @@ privacy:
content:
intro: >
Denna integritetspolicy beskriver hur tjänsten som tillhandahålls på webbsidan <strong>pronouns.page</strong> och relaterade webbplatser hanterar din personliga data.
Tjänsten tillhandahålls av "Neutrala språkets råd"-kollektivet som kan kontaktas via e-post genom:
Tjänsten tillhandahålls av "Neutrala språkets råd"-kollektivet
& Nero Network (NL, KVK 88409120)
som kan kontaktas via e-post genom:
effort: >
Vi ser till att vi sparar din data säkert och försäkrar att all personlig data
blir inte beslagtagen eller skickat till en utomstående, förutom de betrodda partierna beskrivna här

View File

@ -867,6 +867,7 @@ terms:
intro: >
Дані Умови надання послуг регулюють доступ до використання сайту
<strong>pronouns.page / zaimki.pl</strong> під керівництвом колективу "Ради нейтральної мови"
& Nero Network (NL, KVK 88409120)
з ким можна зв'язатися через електронну пошту:
consent: >
Використовуючи надані сервіси, ви погоджуєтеся на дотримання Умов надання послуг, а також на

View File

@ -5,7 +5,11 @@
<T>privacy.header</T>
</h2>
<p class="small"><em><T>terms.lastUpdate</T><T>quotation.colon</T> 2022-09-02</em></p>
<p class="small"><em>
<T>terms.lastUpdate</T><T>quotation.colon</T>
2022-12-29
(registration of a legal entity; switching ads providers)
</em></p>
<div v-if="$te('terms.translationDisclaimer')" class="alert alert-warning">
<Icon v="exclamation-triangle"/>
@ -24,7 +28,7 @@
<p><T>privacy.content.plausible</T></p>
<p><T>privacy.content.hCaptcha</T></p>
<p v-if="config.ads && config.ads.enabled">
<T>privacy.content.ezoic</T>
<T>privacy.content.adsense</T>
</p>
<p><T>privacy.content.logsBackups</T></p>
<p><T>privacy.content.gdpr</T></p>
@ -45,8 +49,7 @@
export default {
methods: {
revokeCookieConsent() {
this.$cookies.remove('cookie-consent');
window.location.reload();
googlefc.callbackQueue.push(googlefc.showRevocationMessage);
},
},
}

View File

@ -99,7 +99,6 @@
<template v-slot:opinions>
<LegendOpinionListInput v-model="defaultOpinions" readonly class="mb-0"/>
<LegendOpinionListInput v-model="opinions" :maxitems="5"/>
<AdPlaceholder phkey="main-0"/>
</template>
<template v-slot:names-header>
@ -112,7 +111,6 @@
</p>
<OpinionListInput v-model="names" :customOpinions="opinions" :maxitems="128"/>
<PropagateCheckbox field="names" :before="beforeChanges.names" :after="names" v-if="otherProfiles > 0" @change="propagateChanged"/>
<AdPlaceholder phkey="main-1"/>
</template>
<template v-slot:pronouns-header>
@ -127,7 +125,6 @@
</p>
</div>
<OpinionListInput v-model="pronouns" :validation="validatePronoun" :customOpinions="opinions" :maxitems="128" :maxlength="192"/>
<AdPlaceholder phkey="main-2"/>
</template>
<template v-slot:description-header>
@ -136,7 +133,6 @@
</template>
<template v-slot:description>
<textarea class="form-control form-control-sm" v-model="description" maxlength="256" rows="8"/>
<AdPlaceholder phkey="main-3"/>
</template>
<template v-slot:flags-header>
@ -167,7 +163,6 @@
</details>
<PropagateCheckbox field="customFlags" :before="beforeChanges.customFlags" :after="customFlags" v-if="otherProfiles > 0" @change="propagateChanged"/>
<Answer question="flags" small/>
<AdPlaceholder phkey="main-4"/>
</template>
<template v-slot:links-header>
@ -193,7 +188,6 @@
<Icon v="exclamation-triangle"/>
<T>profile.linksWarning</T>
</p>
<AdPlaceholder phkey="main-5"/>
</template>
<template v-slot:birthday-header>
@ -212,7 +206,6 @@
<Icon v="times"/>
<T>crud.remove</T>
</button>
<AdPlaceholder phkey="main-6"/>
</template>
<template v-slot:timezone-header>
@ -225,7 +218,6 @@
</p>
<TimezoneSelect v-model="timezone"/>
<PropagateCheckbox field="timezone" :before="beforeChanges.timezone" :after="timezone" v-if="otherProfiles > 0" @change="propagateChanged"/>
<AdPlaceholder phkey="main-0"/>
</template>
<template v-slot:words-header>
@ -243,7 +235,6 @@
<button type="button" class="btn btn-outline-warning btn-sm" @click.prevent="resetWords">
<T>profile.editor.defaults</T>
</button>
<AdPlaceholder phkey="main-1"/>
</template>
<template v-slot:circle-header>
@ -259,7 +250,6 @@
<CircleMentions/>
<AdPlaceholder phkey="main-2"/>
</template>
</TabsNav>
@ -270,7 +260,7 @@
</button>
</section>
<AdPlaceholder phkey="main-6"/>
<AdPlaceholder phkey="main-0"/>
</form>
</div>
</Page>

View File

@ -5,7 +5,11 @@
<T>terms.header</T>
</h2>
<p class="small"><em><T>terms.lastUpdate</T><T>quotation.colon</T> 2022-12-01</em></p>
<p class="small"><em>
<T>terms.lastUpdate</T><T>quotation.colon</T>
2022-12-29
(registration of a legal entity)
</em></p>
<div v-if="$te('terms.translationDisclaimer')" class="alert alert-warning">
<Icon v="exclamation-triangle"/>

View File

@ -1,23 +1,23 @@
export default {
'support': 101,
'support': [2557549454, 'auto', true],
'aside-left-top': 102,
'aside-left-middle': 103,
'aside-left-bottom': 104,
'aside-left-top': null,
'aside-left-middle': [4999879969, 'auto', true],
'aside-left-bottom': null,
'aside-right-top': 105,
'aside-right-middle': 106,
'aside-right-bottom': 107,
'aside-right-top': null,
'aside-right-middle': [2369847195, 'auto', true],
'aside-right-bottom': [6664353412, 'auto', true],
'main-0': 108,
'main-1': 109,
'main-2': 110,
'main-3': 111,
'main-4': 112,
'main-5': 113,
'main-6': 114,
'main-0': [8172838213, 'auto', true],
'main-1': [3299823474, 'auto', true],
'main-2': [3108251782, 'auto', true],
'main-3': [6716873048, 'auto', true],
'main-4': null,
'main-5': null,
'main-6': null,
'footer': 115,
'footer': [6584462360, 'autorelaxed', false],
'small-homepage': 116,
'small-homepage': [6146027401, 'auto', true],
};