Created
April 24, 2017 07:10
-
-
Save swcho/0e8e3fc9c92c3f41109221f3f7a2a897 to your computer and use it in GitHub Desktop.
na
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare var wcs_add; | |
declare var wcs_do; | |
export function setup() { | |
const naverAnalyticsJsUrl = 'https://wcs.naver.net/wcslog.js'; | |
$.getScript(naverAnalyticsJsUrl, function() { | |
wcs_add = wcs_add || {}; | |
wcs_add['wa'] = '395c28a8f51174'; | |
wcs_do(); | |
}); | |
} | |
export function reset() { | |
if (typeof wcs_do !== 'undefined') { | |
wcs_do(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hashHistory = useRouterHistory(createHashHistory)({ | |
queryKey: false, | |
} as any); | |
const store = reducer.createStore({hashHistory}); | |
const history = syncHistoryWithStore(hashHistory as any, store); | |
history.listen((location: Location) => { | |
window.scroll(0, 0); | |
analytics.reset(); | |
}); | |
analytics.setup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment