Skip to content

Commit

Permalink
add posthog via import
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulkgupta committed Jun 7, 2024
1 parent 1cd556f commit de5ba3c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"date-fns": "^2.30.0",
"firebase": "^9.23.0",
"lodash-es": "^4.17.21",
"posthog-js": "^1.138.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -58,8 +59,8 @@
"approvals": "^7.1.0",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"cross-env": "^7.0.3",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.57.0",
Expand Down Expand Up @@ -105,4 +106,4 @@
"eslint"
]
}
}
}
6 changes: 6 additions & 0 deletions src/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Viewport } from './lib/viewport';
import { firebaseConfig } from './services/firebase.js';
import './style/index.scss';
import ReactGA from 'react-ga4';
import posthog from 'posthog-js';

function Inspector() {
this.assetsLoader = new AssetsLoader();
Expand Down Expand Up @@ -329,4 +330,9 @@ Inspector.prototype = {
ReactGA.initialize(firebaseConfig.measurementId);
const inspector = (AFRAME.INSPECTOR = new Inspector());

posthog.init('phc_Yclai3qykyFi8AEFOrZsh6aS78SSooLzpDz9wQ9YAH9', {
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only' // or 'always' to create profiles for anonymous users as well
});

export { inspector };

0 comments on commit de5ba3c

Please sign in to comment.