All Goals
trigger through programmatically are visible in the Experience Profile
> Goal
Report but not in Experience Analytics
Report.
We have triggered goal programmatically and attached with a Contact
. these Goals are visible in Experience Profile
but not in Experience Analytics
.
Need your inputs.
Contact gExistingContact = client.Get<Contact>(new IdentifiedContactReference(_identifier, userKey),
new ContactExpandOptions(PersonalInformation.DefaultFacetKey));
if (gExistingContact != null)
{
Guid glID = Guid.Parse(goalId.ToString());
var goalItem = Sitecore.Context.Database.GetItem(goalId);
var xconnectEvent = new Goal(glID, DateTime.UtcNow);
xconnectEvent.CustomValues.Add("Action", action);
xconnectEvent.CustomValues.Add("PageName", pageName);
xconnectEvent.CustomValues.Add("Date", DateTime.Now.ToString());
if (goalItem != null)
{
if (goalItem["Points"] != null && !string.IsNullOrEmpty(goalItem["Points"].ToString()))
{
xconnectEvent.EngagementValue = goalItem["Points"] == null ? 0 : int.Parse(goalItem["Points"].ToString());
}
}
Guid channelId = Guid.Parse(channelid.ToString());
var useragent = "Mozilla / 5.0(iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit / 602.1.50(KHTML, like Gecko) CriOS / 56.0.2924.75 Mobile / 14E5239e Safari/ 602.1";
Interaction interaction = new Sitecore.XConnect.Interaction(gExistingContact, InteractionInitiator.Contact, channelId, useragent);
interaction.Events.Add(xconnectEvent);
client.AddInteraction(interaction);
client.Submit();
}
Tracker.Current.CurrentPage.RegisterGoal
. You can change you goal to a web interaction or let me find you the setting to include the non-web interaction in EA.