Click or drag to resize
ICurrentContactProviderGetCurrentContact Method
Recognizes contact currently browsing the live site. If contact cannot be recognized a new one is created. A returned contact is always valid (exists in database, is not merged, etc.) and is automatically assigned to currentUser User (if it's not a public user). Contact can only be recognized during web request as RequestDependencies are required in request param.

Namespace: CMS.OnlineMarketing
Assembly: CMS.OnlineMarketing (in CMS.OnlineMarketing.dll) Version: 9.0.0
Syntax
C#
ContactInfo GetCurrentContact(
	RequestDependencies request,
	SiteInfo site,
	CurrentUserInfo currentUser,
	bool forceUserMatching
)

Parameters

request
Type: CMS.OnlineMarketingRequestDependencies
Information about current request
site
Type: CMS.SiteProviderSiteInfo
Site where request happened
currentUser
Type: CMS.MembershipCurrentUserInfo
Currently signed in user or public user
forceUserMatching
Type: SystemBoolean
If true, current contact is tried to be determined by the user even if it can be found by other ways

Return Value

Type: ContactInfo
Recognized contact or new contact, if it was not possible to recognize contact
See Also