Cross-domain tracking can be a little tricky. If you are using Google Analytics 4, you will find that cross-domain tracking has been completely rebuilt. Prior that, you have to configure cross-domain tracking from google tag manager via conversion linker or you have to add a tag in the website to track the measurement.
You must be thinking How does cross-domain tracking actually work?
Google Analytics collects a Client-ID when users come to your site. Client-ID is stored in Cookies and can be used later. But cookies cannot access other website cookies.
When you are doing cross-tracking, Client-ID value has to be transferred from one domain to the other, that means if a user is coming from one website and land on another site it will be counted as a single session and you can track the conversion also.
Google Analytics 4 Cross-Domain Tracking Setup
Step 1: Make sure you have admin permission for Google Analytics4 (GA4) property. Click on Admin > Data Streams > Streams
Step 2: After you have selected the stream, click on “Tagging Settings”
Step 3: Now, Click on “configure your domains“
Step 4: Now you have to click on the “Add Condition” button to add domain URLs. You have to enter both the URLs in separate condition. I have entered optimizegoal.com as first conditions and demo.optimizegoal.com as the second condition.
If you are having 100 of URLs, then listing each condition might be difficult in that case thus, you can use match type as a regex to enter multiple URL at once.
Step 5: Now press the save button.
You have completed all the steps. Your Google Analytics 4 properties will now track users navigating between domains (domain A & domain B) also you can track conversion easily without any hassles. This saves a lot of time and helps you to get accurate data.