Unified · Split
| @@ -41,8 +41,7 @@ page.show = (path, state) -> · 40 unmodified lines | ||
| 41 | 41 | currentState = context.state |
| 42 | 42 | page.dispatch(context) |
| 43 | 43 | context.pushState() |
| 44 | − ga?('send', 'pageview', location.pathname + location.search + location.hash) | |
| 45 | − _gauges?.push(['track']) | |
| 44 | + track() | |
| 46 | 45 | context |
| 47 | 46 | |
| 48 | 47 | page.replace = (path, state, skipDispatch, init) -> |
| @@ -51,8 +50,7 @@ page.replace = (path, state, skipDispatch, init) -> · 2 unmodified lines | ||
| 51 | 50 | currentState = context.state |
| 52 | 51 | page.dispatch(context) unless skipDispatch |
| 53 | 52 | context.replaceState() |
| 54 | − ga?('send', 'pageview', location.pathname + location.search + location.hash) unless init | |
| 55 | − _gauges?.push(['track']) | |
| 53 | + track() unless init or skipDispatch | |
| 56 | 54 | context |
| 57 | 55 | |
| 58 | 56 | page.dispatch = (context) -> |
| @@ -163,3 +161,8 @@ onclick = (event) -> · 104 unmodified lines | ||
| 163 | 161 | |
| 164 | 162 | isSameOrigin = (url) -> |
| 165 | 163 | url.indexOf("#{location.protocol}//#{location.hostname}") is 0 |
| 164 | + | |
| 165 | +track = -> | |
| 166 | + ga?('send', 'pageview', location.pathname + location.search + location.hash) | |
| 167 | + _gauges?.push(['track']) | |
| 168 | + return | |