Too Many Contacts Being Created

Joseph Pike asked on November 12, 2021 09:24

Hey guys, I've just started doing some work with personalization in Kentico 13 (MVC)... I'm running into an issue on my production site where way too many anonymous contacts are being created per minute (some with no activities!). I think this may have do with our cloudflare setup, but is there any good explanation anywhere on how Kentico handles the creation of anonymous contacts? Or any suggestions as to how I could limit the creation of contacts to real users? Thank you!

-Joey

Recent Answers


David te Kloese answered on November 12, 2021 10:08

Could it be you're site is being hit a lot by crawlers or indexers? As those usually don't have much actions.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 12, 2021 10:23

Isn't there any health checker from Cloudflare doing any requests? These could be recognized as new users in Kentico too.

1 votesVote for this answer Mark as a Correct answer

Joseph Pike answered on November 12, 2021 14:12

I think you are both right, I'm getting hit by a ton of health checks from cloudflare & maybe a smaller number of crawlers / indexers... do you guys have a suggestion on how to discern these from "real users" so to speak?

0 votesVote for this answer Mark as a Correct answer

Joseph Pike answered on November 23, 2021 04:38

Hey guys -- any thoughts on the above? I ended up extending the IsCrawler method to basically flag anything that didn't have a specific Cookie as a crawler, but I'm still getting way too many anonymous contacts?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on November 23, 2021 08:56

Can't you detect the Cloudflare healthchecks (perhaps some header) and skip those? Or perhaps you can just cleanup anonymous contacts that have no activities or updates after x time.

How many contacts do you get?

0 votesVote for this answer Mark as a Correct answer

Joseph Pike answered on November 23, 2021 15:33 (last edited on November 23, 2021 15:51)

Hey David, so yes my thinking was the same in terms of skipping the cloudflare healthchecks -- I extended the IsCrawler method (see below) so that anything that didn't have a specific cookie (which can only be added by clicking "Accept" on the GDPR banner) gets flagged as a crawler and thus shouldn't be creating a contact...

       public bool IsCrawler()
    {
        HttpContext context = HttpContext.Current;

        bool hasAcceptedGDPR = context.Request.Cookies.AllKeys.Contains("ssb-gdprDate");

        HttpBrowserCapabilitiesBase browser = CMSHttpContext.Current?.Request?.Browser;

        return browser != null && browser.Crawler || !hasAcceptedGDPR;

    }

it seemed to be working for a few of the cloudflare requests but not sure if I should try and extend some other functionality. Maybe something like this? https://docs.xperience.io/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-contacts/configuring-contact-recognition

I also considered restricting based on IP range / User-Agent or another header, but the requests seemed to be too varied for that

Edit: I'm also getting about 8 contacts per minute or 80k per week so not sure it would be tenable to do the cleanup inactive contact strategy?

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.