Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

enhancement request: integrate with vue-router #1

Open
chrisbraddock opened this issue Dec 14, 2016 · 4 comments
Open

enhancement request: integrate with vue-router #1

chrisbraddock opened this issue Dec 14, 2016 · 4 comments

Comments

@chrisbraddock
Copy link

Similar to vue-analytics, allow passing a router instance as an option:

import router from './router'
import VueFacebookPixel from 'vue-analytics-facebook-pixel'

Vue.use(VueFacebookPixel, { router })

and automatically fire 'PageView' on route change

@sobolevn
Copy link
Member

Sure thing, thanks!

PRs are welcome, if you are interested!

@chrisbraddock
Copy link
Author

If I get to it before you, for sure. :)

@rafapg
Copy link

rafapg commented Mar 5, 2018

According to Facebook Pixel documentation, all changes in the history state is automatically tracked as a PageView. Perhaps this feature is significant only in the cases when router is used in hash mode.

By default Facebook Pixel activates the HTML 5 History State API listener. This means that each time a new state appears in the history, such as history.pushState, Facebook Pixel fires a PageView event. Note that due to the way we designed Facebook Pixel's JavaScript code, you cannot fire more than one PageView event explicitly without this listener.

@sobolevn
Copy link
Member

sobolevn commented Mar 6, 2018

@rafapg do you have any opportunity to investigate this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants