Hot answers tagged

3

There is no condition-based submit action in Sitecore Forms yet but you can achieve this by adding your custom action or using conditional logic for your forms. I have not tried this yet but I will suggest the conditional logic for this. The Sitecore Forms application lets you apply conditional actions to fields in web forms. You can apply conditions to ...


3

from your code getContact != null, if this condition is false, then you are creating new contact which is incorrect. Contact contact = new Sitecore.XConnect.Contact(new ContactIdentifier(phoneAsChannel, contactus.email, ContactIdentifierType.Known)); Sitecore has already created an anonymous contact and set it in the device cookie ...


2

Goals of the current visit (interaction) are stored in the session and can be retrieved using Tracker API: List<PageEventData> pageGoals = Sitecore.Analytics.Tracker.Current.Interaction.Pages .SelectMany(p => p.PageEvents) .Where(evt => evt.IsGoal) ....


1

For your user case, you need to configure the goal as a live event: https://doc.sitecore.com/developers/100/sitecore-experience-platform/en/live-event-detection.html


1

If your forms are in AJAX mode, your issue is going to be that tracker is configured to not run on Forms Ajax mode. Not sure why. At the top of your code, add this. if (Tracker.Current == null && Tracker.Enabled) { Tracker.StartTracking(); } Then do your normal xConnect code var firstNameField = GetFieldById(data.FirstNameFieldId, ...


1

Similar to @Anton's example, you can achieve the same result with a Tag Manager solution. Summary Add an API to receive requests Add Tag Manager Content Authors can then create events/goals and trigger them on any action available with the Tag Manager Sitecore GTM (API) https://github.com/kazimnami/Sitecore.Commerce.ProductEngagement This repo, most ...


Only top voted, non community-wiki answers of a minimum length are eligible