Skip to content

Latest commit

 

History

History

google-analytics

Google Analytics Example

In this setup we will setup Google Analytics with Remix.

Preview

Open this example on CodeSandbox:

Open in CodeSandbox

Example

This example shows how to use Google analytics with Remix.

  • Copy .env.example to .env
  • Configure your Google Analytics ID in the .env file (read from the entry.server.tsx file)
  • Run the project

Check app/root.tsx where page tracking code is added. For tracking events check app/routes/contact.tsx file.

The Google Analytics tag is disabled in "development", you can enable it during your test, but make sure to only enable tracking in production.

Related Links

Google Analytics