Skip to content

Instantly share code, notes, and snippets.

@swcho
Created April 24, 2017 07:10
Show Gist options
  • Save swcho/0e8e3fc9c92c3f41109221f3f7a2a897 to your computer and use it in GitHub Desktop.
Save swcho/0e8e3fc9c92c3f41109221f3f7a2a897 to your computer and use it in GitHub Desktop.
na
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();
}
}
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