Comments (8)
@jrpersico-spurred So you are calling the track function manually? Could you paste your code?
from gridsome-plugin-segment-js.
Yes I do !
in templates/ContentfulBlogPost.vue
mounted () { this.$segment.page(this.$page.post.category, this.$page.post.title, { title: this.$metaInfo.title }) }
When I go to a post, no worries.
But if I navigate from a post to another post with the same template, tracking doesn't run again.
from gridsome-plugin-segment-js.
Yes, that is probably because mounted hooks are not necessarily rerun on a page change, if the layout is exactly the same, but the content changes - using the same template for instance.
I suggest you instead use the router.afterEach
hook to fire the analytics tracking function. You can see an example of this in this plugins gridsome.client.js
.
from gridsome-plugin-segment-js.
Ok thank you I was able to fix the problem !
But unfortunately when trackPage is set to false, referrer is empty in segment...
Do you have any idea ?
Thanks
from gridsome-plugin-segment-js.
Empty or always with the same value
from gridsome-plugin-segment-js.
Did you add https://www.github.com/thetre97/gridsome-plugin-segment-js/tree/master/gridsome.client.js#L22?
from gridsome-plugin-segment-js.
Nope, finally I don't use the router...
I need to set different categories for each pages or templates...
Maybe you have a tip ?
from gridsome-plugin-segment-js.
In that case, sorry, no - not sure how you can get the referrer otherwise. I don't believe it is available in the $route
property.
from gridsome-plugin-segment-js.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gridsome-plugin-segment-js.