To find the snippet, login at app.posthog.com
Now, go to ‘Setup’ in the left hand navigation:
Enter the domain of your application then press ‘Save url’.
Now, under ‘Integrate PostHog’, copy the code snippet.
Paste this within the
<head> tags of your application, ideally just above the closing
We recommend putting PostHog both on your homepage and your application if applicable. That means you'll be able to follow a user from the moment they come onto your website, all the way through Sign Up and actually using your product.
PostHog can also support tracking across multiple URLs and domains. In Setup you can select '+ Add Another URL'.
You can then enter multiple URLs that you would like to track activity for.
To check that events tracking is working, navigate to your application and verify that you can see the snippet in the correct place.
Now, visit a URL of your application. Then, go back to PostHog.
Click ‘Events’ in the left hand Navigation:
You should be able to see a list of events, when they took place and the path containing the URL you visited.
You should be able to see a list of events, when they took place, and the path containing the URL you visited.
PostHog puts a great amount of effort into making sure it doesn't capture any sensitive data from your website. If there are other elements you don't want to be captured, you can add the
ph-no-capture class name.
<button class='ph-no-capture'>Sensitive information here</button>