mirror of
https://github.com/wahyd4/badger.git
synced 2026-08-09 05:15:58 +10:00
Add GA track
This commit is contained in:
+32
-5
@@ -24,12 +24,29 @@
|
||||
</b-navbar>
|
||||
<Nuxt />
|
||||
<b-row class="row-space footer">
|
||||
<b-col md="2" offset-md="5">
|
||||
<div class="copyright">
|
||||
© 2020 toozhao.com
|
||||
</div>
|
||||
<b-col md="4" offset-md="4">
|
||||
<span class="copyright">
|
||||
© 2020 toozhao.com <img :src="myBadge" class="my-badge"/>
|
||||
</span>
|
||||
|
||||
</b-col>
|
||||
</b-row>
|
||||
<div v-if="isProduction">
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script
|
||||
async
|
||||
src="https://www.googletagmanager.com/gtag/js?id=UA-5243064-21"
|
||||
></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag("js", new Date());
|
||||
|
||||
gtag("config", "UA-5243064-21");
|
||||
</script>
|
||||
</div>
|
||||
</b-overlay>
|
||||
</template>
|
||||
|
||||
@@ -39,8 +56,14 @@ import { mapMutations } from "vuex";
|
||||
|
||||
export default Vue.extend({
|
||||
computed: {
|
||||
isLoading() {
|
||||
isLoading(): boolean {
|
||||
return this.$store.state.loading.loading;
|
||||
},
|
||||
isProduction(): boolean {
|
||||
return this.$config.env == "production";
|
||||
},
|
||||
myBadge(): string {
|
||||
return `${this.$config.myBadge}/green.svg`
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -67,6 +90,10 @@ html {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.my-badge {
|
||||
display: inline;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
*,
|
||||
*::before,
|
||||
|
||||
@@ -67,6 +67,7 @@ export default {
|
||||
'/api/': process.env.NODE_ENV === 'production' ? 'https://badges.toozhao.com' : 'http://localhost:8080',
|
||||
},
|
||||
publicRuntimeConfig: {
|
||||
env: process.env.NODE_ENV,
|
||||
baseURL: process.env.BASE_URL || 'http://localhost:3000',
|
||||
backendURL: process.env.NODE_ENV === 'production' ? 'https://badges.toozhao.com' : 'http://localhost:8080',
|
||||
myBadge: process.env.NODE_ENV === 'production' ? 'http://localhost:8080/badges/01EGTQ3JBFYS7VZG36SBPM0SA9' : 'https://badges.toozhao.com/badges/01EGTQ64XK7M48A67K9Y62J0QZ'
|
||||
|
||||
Reference in New Issue
Block a user