Skip to content

Commit

Permalink
try
Browse files Browse the repository at this point in the history
  • Loading branch information
shayaulman committed Oct 1, 2020
1 parent 1bcac19 commit edb4d48
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
7 changes: 7 additions & 0 deletions src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
class="bmc-button bg-custom-bg-card text-custom-text-primary"
target="_blank"
href="https://www.buymeacoffee.com/shayaulman"
@click="track"
><img
src="https://www.buymeacoffee.com/assets/img/BMC-btn-logo.svg"
alt="Buy me a coffee"
Expand Down Expand Up @@ -50,6 +51,12 @@ export default {
],
};
},
methods: {
track() {
console.log(this.$analytics.trackEvent);
this.$analytics.trackEvent("Buy Me A Coffee", "Click");
},
},
};
</script>

Expand Down
56 changes: 29 additions & 27 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,7 @@ export default function(Vue, { router, head, isClient, appOptions }) {
Vue.use(Vuex);
Vue.use(vueSmoothScroll);
Vue.use(InfiniteLoading);
Vue.use(VueAnalytics, {
// [Required] The name of your app as specified in Google Analytics.
appName: "kosherCode",
// [Required] The version of your app.
appVersion: "1.0.0",
// [Required] Your Google Analytics tracking ID.
trackingId: "UA-153721766-1",
// If you're using vue-router, pass the router instance here.
// vueRouter: router,

// Global Dimensions and Metrics can optionally be specified.
// globalDimensions: [
// { dimension: 1, value: 'FirstDimension' },
// { dimension: 2, value: 'SecondDimension' }
// // Because websites are only 2D, obviously. WebGL? What's that?
// ],

// globalMetrics: [
// { metric: 1, value: 'MyMetricValue' },
// { metric: 2, value: 'AnotherMetricValue' }
// ]
});

router.beforeEach((to, from, next) => {
console.log(to.path);
Vue.analytics.trackView(to.path);
next();
});
Vue.filter("number", (value) =>
isNaN(value) ? "" : Number(value).toLocaleString("en")
);
Expand All @@ -51,6 +24,35 @@ export default function(Vue, { router, head, isClient, appOptions }) {
const Paginate = require("vuejs-paginate");

Vue.component("Paginate", Paginate);

Vue.use(VueAnalytics, {
// [Required] The name of your app as specified in Google Analytics.
appName: "kosherCode",
// [Required] The version of your app.
appVersion: "1.0.0",
// [Required] Your Google Analytics tracking ID.
trackingId: "UA-153721766-1",
// If you're using vue-router, pass the router instance here.
// vueRouter: router,
trackPage: true,

// Global Dimensions and Metrics can optionally be specified.
// globalDimensions: [
// { dimension: 1, value: 'FirstDimension' },
// { dimension: 2, value: 'SecondDimension' }
// // Because websites are only 2D, obviously. WebGL? What's that?
// ],

// globalMetrics: [
// { metric: 1, value: 'MyMetricValue' },
// { metric: 2, value: 'AnotherMetricValue' }
// ]
});
router.beforeEach((to, from, next) => {
console.log(to.path);
Vue.analytics.trackView(to.path);
next();
});
}

appOptions.store = new Vuex.Store({
Expand Down

0 comments on commit edb4d48

Please sign in to comment.