aleross / angular-segment-analytics

AngularJS module for easily adding Segment analytics to any app. https://segment.com
MIT License
43 stars 14 forks source link

wrapper does not define SNIPPET_VERSION: Segment falls back to automatic initial page view #22

Open jrencz opened 8 years ago

jrencz commented 8 years ago

Segment started versioning its snippet. Right now it's 3.1.0 according to https://segment.com/docs/sources/website/analytics.js/quickstart/

What's important is that they moved the initial page view tracking from the analytics.js to the snippet. But if there's no SNIPPET_VERSION they fall back to the old behaviour.

I noticed that I'm tracking initial page view twice in my angular 1.5 app where I call segment.page() in $stateChangeSuccess handler.

I reviewed the code that loads analytics.js and I saw no major differences. @aleross can you review the code as well and verify it's safe to just add analytics.SNIPPET_VERSION = '3.1.0'?