Phoenix web analytics installation

Go to your project settings and copy your web snippet. It looks like this:

JavaScript

With the JavaScript snippet copied, add it to your main layout file, usually located in lib/<app>/templates/layouts/app.html.eex at the bottom of the <head> tag.

After installing PostHog and ensuring autocapture is enabled, head to your web analytics dashboard to see your data. And then check out our getting started guide.

PostHog tip: Web analytics works with anonymous events. This means if you are primarily using PostHog for web analytics, it can be significantly cheaper for you.

Community questions

Was this page useful?

Questions about this page? or post a community question.