Google Analytics

Google Analytics

💡
Follow this guide to get Google Analytics setup in your Divjoy codebase. Click the ▶︎ icon next to any step to see a detailed walkthrough with screenshots. If anything is confusing please reach out.

Basic Setup

Create a new "Universal Analytics Property" in Google Analytics. When setting up your property you'll need to click the "Advanced Options" link and then select "Create a Universal Analytics Property only". The analytics library we use doesn't yet work with the new "Google Analytics 4" property type (see Github issue here).
image
After creating your property, copy the "Tracking Id" and then add it to your codebase .env file.
Go to "Property Settings" and copy your "Tracking Id"
Go to "Property Settings" and copy your "Tracking Id"

🙌
You should now have a working analytics in your web app

Troubleshooting

Workaround with Google Analytics for Firebase (Property format change from UA-* to G-*)

When creating a new Firebase project with DivJoy, you are given the option to create and connect a new Google Analytics property for the project. (See image below)

Google Analytics for Firebase is auto-generating unique property identifiers that are incompatible with DivJoy with an analytics property format of "G-123456".

We recommend that you create a new property directly in Google Analytics with the original analytics property format of "UA-123abc" while we add support for the new Google Analytics for Firebase.

image