Google Analytics 4 will be replacing the legacy Universal Analytics in future. However, it is currently not possible to link Google Analytics 4 directly to Google Search Console. So there is a workaround as follows:
Create Both Google Analytics 4 and Universal Analytics Properties
If this is a new site or if you are setting up a new tracking property from scratch, then proceed to setup a Universal Analytics property first.
- Go to <Admin> (bottom left corner) to access your Admin Area.
- Click <Create Property>, scroll to bottom and select <See advance options>, and enable Universal Analytics.
- Enter your website domain, and then select <Create both a Google Analytics 4 and a Universal Analytics property>
- This will create both UA and the new GA4 property at the same time.
- After you setup, under your UA property, go to <Tracking Info>, <Tracking Code>, you will see this the following codes:
where “UA-XXXXXXXX-X” is your existing or legacy Google Analytics tracking code.
- Next, go to your Google Analytics 4 property, go to <Data Stream>, and <Add Stream>.
- You may select “Web” stream during creation.
- Click the stream that you have created and look for the <Tagging Instructions> and under this, click this section <Global site tag (gtag.js) …>
where “G-YYYYYYYYYY” is your new Google Analytics 4 tracking code.
How To Add Google Analytics 4 and Universal Analytics To Your Website?
Instead of pasting both sets of codes into your website headers, you can combine both by adding the “Config” line.
Next, there is one last step where you will need to go to your UA property
- Go to <Google Analytics 4 Property Setup Assistant>
- Under <I want to connect to an existing Google Analytics 4 property>, select the G4 property from the drop down list.
After this is done, you may now connect Google Search Console to your Universal Analytics property, which is in turn connected to your new Google Analytics 4 property.