First of all, spam links should be detected. After the links are detected, we click on the filters under the Administrator tab.
We select the new filter option. In the filter model section, we write the domain of the spam site.
After a short time after applying them, you will see that these links are coming out of your Google Analytics data.
The more accurate your Google Analytics results reflect, the more consistent your analysis will be.
Note: The filters you put in Google Anlaytics do not prevent traffic to your site, they only prevent you from seeing this data.