Skip to main content

Via index.html

The quickest way: add the script to your index.html before </body>:
index.html

Via Vue plugin

For Vue Router apps, register a simple plugin in main.ts so pageviews are tracked on every route change:
main.ts
OpenRevenue’s tracker automatically listens to history.pushState and popstate so route changes in Vue Router are tracked without any extra config.

Verify

Deploy your app and visit it in a browser. A pageview should appear in your OpenRevenue dashboard within seconds.
OpenRevenue ignores localhost automatically. Always test on your deployed URL.