[Add] Add GA to public and config file
change /news to /cfp/news
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>{{{ %GA_TEMPLATE% }}}</noscript>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
|
||||
Please enable it to continue.</strong>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<div class="button-post">
|
||||
<button
|
||||
class="buttons"
|
||||
onclick="window.location.href='/news'"
|
||||
onclick="window.location.href='/cfp/news'"
|
||||
><h3>投稿資訊</h3></button>
|
||||
<!-- NOTE: this button's hover won't work because paper.png is too big -->
|
||||
<button
|
||||
|
||||
@@ -26,7 +26,7 @@ export const routes: RouteConfig[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/news',
|
||||
path: '/cfp/news',
|
||||
name: 'news',
|
||||
component: News,
|
||||
meta: {
|
||||
|
||||
98
template/ga.html
Normal file
98
template/ga.html
Normal file
@@ -0,0 +1,98 @@
|
||||
<!-- Google Tag Manager -->
|
||||
<script type=application/ld+json>
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Event",
|
||||
"name": "SITCON 學生計算機年會 2021",
|
||||
"startDate": "2021-05-29T08:30+08:00",
|
||||
"location": {
|
||||
"@type": "Place",
|
||||
"name": "中央研究院人文社會科學館",
|
||||
"address": {
|
||||
"@type": "PostalAddress",
|
||||
"streetAddress": "研究院路二段 128 號",
|
||||
"addressLocality": "Nangang District",
|
||||
"postalCode": "115",
|
||||
"addressRegion": "Taipei",
|
||||
"addressCountry": "TW"
|
||||
}
|
||||
},
|
||||
"organizer": {
|
||||
"@type": "Organization",
|
||||
"url": "https://sitcon.org",
|
||||
"name": "SITCON 學生計算機年會",
|
||||
"logo": "https://sitcon.org/branding/withname.png",
|
||||
"sameAs": [
|
||||
"https://www.youtube.com/user/SITCONArchive",
|
||||
"https://www.facebook.com/SITCONtw/",
|
||||
"https://twitter.com/sitcontw"
|
||||
]
|
||||
},
|
||||
"image": [
|
||||
"https://sitcon.org/2021/OG-image.png"
|
||||
],
|
||||
"description": "二十一世紀已經過了五分之一,今年,我們期待帶著豐沛熱情的你,能和我們一起在 2021 年這麼一個「承先啟後」的年份,綜觀不同領域發展與事件脈絡,自主學習感興趣之專長與技術,彼此分享、相濡以沫。在 SITCON 學生計算機年會 2020 裡,願所有與會者皆能拓展視野,鍛鍊與發展自我,找到向前邁步的勇氣與目標。相信身為學生的我們,也將能重新定義自我、定義未來!",
|
||||
"endDate": "2021-05-29T18:00+08:00",
|
||||
"offers": [
|
||||
{
|
||||
"@type": "Offer",
|
||||
"name": "個人贊助票",
|
||||
"url": "https://sitcon.kktix.cc/events/sitcon2020-individual-sponsor",
|
||||
"price": "1000",
|
||||
"priceCurrency": "TWD",
|
||||
"availability": "http://schema.org/InStock",
|
||||
"validFrom": "2019-10-14T00:00+08:00"
|
||||
},
|
||||
{
|
||||
"@type": "Offer",
|
||||
"name": "個人贊助票(純粹贊助)",
|
||||
"url": "https://sitcon.kktix.cc/events/sitcon2021-individual-sponsor1",
|
||||
"price": "500",
|
||||
"priceCurrency": "TWD",
|
||||
"availability": "http://schema.org/InStock",
|
||||
"validFrom": "2019-10-14T00:00+08:00"
|
||||
}
|
||||
],
|
||||
"performer": {
|
||||
"@type": "Organization",
|
||||
"url": "https://sitcon.org",
|
||||
"name": "SITCON 學生計算機年會",
|
||||
"logo": "https://sitcon.org/logo/sitcon.png",
|
||||
"sameAs": [
|
||||
"https://www.youtube.com/user/SITCONArchive",
|
||||
"https://www.facebook.com/SITCONtw/",
|
||||
"https://twitter.com/sitcontw"
|
||||
]
|
||||
},
|
||||
"eventStatus": "EventRescheduled",
|
||||
"previousStartDate": "2021-05-29T08:30+08:00"
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
(function (w, d, s, l, i) {
|
||||
w[l] = w[l] || [];
|
||||
w[l].push({
|
||||
'gtm.start': new Date().getTime(),
|
||||
event: 'gtm.js'
|
||||
});
|
||||
var f = d.getElementsByTagName(s)[0],
|
||||
j = d.createElement(s),
|
||||
dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||
j.async = true;
|
||||
j.src =
|
||||
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||
f.parentNode.insertBefore(j, f);
|
||||
})(window, document, 'script', 'dataLayer', 'GTM-NPVBCDZ');
|
||||
</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-34467841-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-34467841-1');
|
||||
</script>
|
||||
@@ -1,7 +1,7 @@
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
|
||||
//const gaTempHTML = fs.readFileSync(path.join(__dirname, "./template/ga.html"));
|
||||
const gaTempHTML = fs.readFileSync(path.join(__dirname, "./template/ga.html"));
|
||||
|
||||
//const sessionData = require(path.join(__dirname, "./public/json/session.json"));
|
||||
|
||||
@@ -14,11 +14,20 @@ module.exports = {
|
||||
'/2021/',
|
||||
'/2021/cfp',
|
||||
'/2021/cfp/',
|
||||
'/'
|
||||
'/2021/cfp/news',
|
||||
'/2021/cfp/news/'
|
||||
],
|
||||
useRenderEvent: true,
|
||||
headless: true,
|
||||
onlyProduction: true
|
||||
onlyProduction: true,
|
||||
postProcess: (route) => {
|
||||
// Auto inject GA template
|
||||
route.html = route.html.replace(
|
||||
"<noscript>{{{ %GA_TEMPLATE% }}}</noscript>",
|
||||
gaTempHTML
|
||||
);
|
||||
return route;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user