Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const createLogger = (environment?: ?string = process.env.NODE_ENV) => {
mixpanel.init(MIXPANEL_KEY);
// Every user is given a distinct ID so that we can track return visits.
// Because electron doesn't persist cookies, we have to do this ourselves.
let distinctId = electronStore.get(DISTINCT_ID_KEY);
if (!distinctId) {
distinctId = uuid();
electronStore.set(DISTINCT_ID_KEY, distinctId);
}
mixpanel.identify(distinctId);
return {
logEvent: (event: EventType, data: any) => {
if (environment !== 'production') {
console.info('Event tracked', event, data);
return;
registerUser(currentEducator) {
try {
if (!isEnabled()) return;
mixpanel.init(readEnv().mixpanelToken);
mixpanel.set_config({
track_pageview: true,
secure_cookie: true,
cross_subdomain_cookie: false // https://help.mixpanel.com/hc/en-us/articles/115004507486-Track-Across-Hosted-Subdomains
});
mixpanel.identify(currentEducator.id);
mixpanel.register({
'deployment_key': readEnv().deploymentKey,
'district_key': readEnv().districtKey,
'educator_id': currentEducator.id,
'educator_is_admin': currentEducator.admin,
'educator_school_id': currentEducator.school_id
});
}
catch (err) {
console.error(err); // eslint-disable-line no-console
replaceFocus: false,
previewData: [],
searchScope: this.hasSelection > 0 ? "layers" : "page"
}
this.findReplace = new FindReplace()
this.enterFunction = this.enterFunction.bind(this)
this.onSubmit = this.onSubmit.bind(this)
this.onCaseSensitiveChange = this.onCaseSensitiveChange.bind(this)
this.handleFindHistory = this.handleFindHistory.bind(this)
this.handleRadioSelection = this.handleRadioSelection.bind(this)
this.handleReplaceHistory = this.handleReplaceHistory.bind(this)
this.onChange = this.onChange.bind(this)
this.clearInput = this.clearInput.bind(this)
// Tracking
mixpanel.init(mixpanelId)
}
import { useRouterHistory } from 'react-router';
import createStore from './createStore';
import ApiClient from './helpers/ApiClient';
// import io from 'socket.io-client';
import {Provider} from 'react-redux';
import {reduxReactRouter, ReduxRouter} from 'redux-router';
import match from 'react-router/lib/match';
import getRoutes from './routes';
import makeRouteHooksSafe from './helpers/makeRouteHooksSafe';
import ga from 'react-ga';
import mixpanel from 'mixpanel-browser';
ga.initialize('UA-61723493-3');
mixpanel.init('f85adcbd0f97f6101ebd440e931197b2');
const client = new ApiClient();
import Html from './helpers/Html';
const appHistory = useScroll(useRouterHistory(createBrowserHistory))();
const newHistory = () => appHistory;
const dest = document.getElementById('content');
const store = createStore(reduxReactRouter, makeRouteHooksSafe(getRoutes), newHistory, client, window.__INITIAL_STATE__);
const routes = getRoutes(store, history);
const component = (
export const createLogger = (environment?: ?string = process.env.NODE_ENV) => {
mixpanel.init(MIXPANEL_KEY);
let distinctId = getDistinctId();
mixpanel.identify(distinctId);
return {
logEvent: (event: EventType, data: any) => {
if (environment !== 'production') {
console.info('Event tracked', event, data);
return;
}
mixpanel.track(event, data);
},
};
};
componentDidMount() {
mixpanel.init('333f6269317ae9b78a29c535e29f00bf')
mixpanel.track("Login Page");
}
componentDidMount() {
const { markdownRemark: page } = this.props.data;
if (process.env.GATSBY_MIXPANEL_KEY) {
mixpanel.init(process.env.GATSBY_MIXPANEL_KEY)
mixpanel.track(`docs.view:${page.frontmatter.title}`)
}
}
componentDidMount() {
mixpanel.init('333f6269317ae9b78a29c535e29f00bf')
mixpanel.track("Rubrics Index Component Page");
}
constructor(props) {
super(props);
const tracking = localStorage.getItem("tracking") === "true";
mixpanel.init(process.env.REACT_APP_MIXPANEL_TOKEN, { opt_out_tracking_by_default: !tracking });
this.closeModal = this.closeModal.bind(this);
this.handleModalNo = this.handleModalNo.bind(this);
this.handleModalYes = this.handleModalYes.bind(this);
this.state = {
modalOpen: localStorage.getItem("tracking") === null
};
}
componentDidMount() {
mixpanel.init('333f6269317ae9b78a29c535e29f00bf')
mixpanel.track("Profile Page");
}