If you are using WebSDK, ensure that your analytics and target calls are part of the same rule. Please refer to the "all pages - library load - AA & AT rule" example in the page https://experienceleague.adobe.com/docs/platform-learn/implement-web-sdk/applications-setup/setup-target.html?lang=en