Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
14 votes

Can I register an event or goal through an API from Javascript?

Yes you can. In this post http://ggullentops.blogspot.be/2016/02/integrating-addthis-with-sitecore-goals.html I described how you can trigger a goal from AddThis (so actually using javascript to call ...
Gatogordo's user avatar
  • 20.1k
10 votes
Accepted

Can I register an event or goal through an API from Javascript?

There are two ways to register goals from JavaScript that I am aware of: Federated Experience Manager Sitecore FXM allows you to make visits and trigger events from external websites. There's an ...
Dmytro Shevchenko's user avatar
7 votes
Accepted

What is the correct way to set a page load goal?

Rules are used for something else. You are correct to associate goal instead. Also make sure to deploy goal. 1) Associate goal with an item To associate a goal with an item, from the Sitecore ...
Peter Procházka's user avatar
6 votes
Accepted

How do I execute an action when a user clicks a link in an EXM email?

I think the part you might be missing is that actual action of clicking a link in an EXM sent email message is that the link goes to a page that sits outside of the Sitecore item structure. That page ...
Pete Navarra's user avatar
  • 14.7k
6 votes
Accepted

Displaying custom event data in Experience Profile

The Goal data is not automatically show in experience profile. So you would need to do some SPEAK UI editing. You can add more columns to the Goal View tab in the Experience Profile by adding new ...
Jarmo Jarvi's user avatar
5 votes
Accepted

Refreshing KeyBehaviorCache after triggering a goal

You can test if a goal has been triggered with this code. It looks in KBC and the current session. public bool IfGoalAlreadyExists(ID goalId) { // this will get all the goals that have ever ...
Chris Auer's user avatar
  • 13.1k
5 votes

Is it possible to associate goal triggering on button click without code?

Honestly I was looking into this myself too. And whereas Mark says that this is not possible that is (for as far as I am aware) still true. However, I don't agree that you should look whether or not ...
Kris Verheire's user avatar
5 votes

Is it possible to associate goal triggering on button click without code?

No. You can only associate goals to items. Described here: Associate a goal with an item But I would add; you're likely also thinking about this wrong. The goal you have, is not "the user presses ...
Mark Cassidy's user avatar
  • 25.3k
5 votes
Accepted

How to view triggered goals

You can see it 2 different ways : If it is pagebased goal then goto that item in sitecore and then click analyze panel and then click on reports and select page - goals and events By going to the ...
Mrunal Daftari's user avatar
5 votes
Accepted

Tracker.Current is not initialized when accessed from another web portal

Tracker.Current relies on HTTP Session Context existing. Web API does not instantiate a Session object, thereby making Tracker completely unusable. You can only use Tracker in the context of a Web ...
Pete Navarra's user avatar
  • 14.7k
4 votes
Accepted

How to check if a Goal with specific ID has been ever registered for the contact?

Slow approach You could load all previous visits using this code: IEnumerable<IInteractionData> visits = Tracker.Current.Contact.LoadHistorycalData(visitsToLoad); Then you could check every ...
Dmytro Shevchenko's user avatar
4 votes

How to check whether goal has been triggered in mongoDB collection

If you just want to validate if the page event was saved, you can run a MongoDB query against Interactions collection: db.Interactions.find({"$and": [ {"Pages":{"$elemMatch": {"PageEvents"...
grg's user avatar
  • 1,811
4 votes

What is the correct way to set a page load goal?

Since you mention rules, if you do want to introduce rules so that you only trigger goal registration if other conditions are true then you can extend the processItem pipeline defined in Sitecore....
Nick Allen's user avatar
4 votes

Trigger Goal if Checkbox is Checked in Contact Form

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 ...
Mahendra Shekhawat's user avatar
3 votes
Accepted

Programmatically getting list of goals triggered through xConnect for certain contact

Found answer after going through xConnect documentation more thoroughly. Here is the code that you can use to get all goals for contact: using (Sitecore.XConnect.Client.XConnectClient client = ...
Peter Procházka's user avatar
3 votes

How can I connect two goals to a page test?

If you go to your page test definition in the content editor under /sitecore/system/Marketing Control Panel/Test Lab after the draft has been saved, you can see that there is a Conversion field that ...
Ben Golden's user avatar
  • 3,313
3 votes
Accepted

Sitecore personalization rule "goal was triggered during a past or current interaction" not being triggered

After spending some time with the question asker, we determined the root issue. The root problem statement was that Personalization wasn't occuring unless the user in the above example refreshed ...
Pete Navarra's user avatar
  • 14.7k
3 votes
Accepted

Prevent repetition from triggering goal

Assumption Once the goal has been triggered by a visitor, the visitor cannot trigger the same goal. Solution If you are triggering the goal programmatically, you can check if the user has already ...
Hishaam Namooya's user avatar
3 votes
Accepted

Programmatically triggering goal while not triggering Path Analyzer

You need to do two things to make the goal show up and the API not be in the tracker. As you said in your question, you need to cancel the current call. I do this with a little cotroller atribute I ...
Chris Auer's user avatar
  • 13.1k
3 votes
Accepted

How can I find out Triggered Goal on Sitecore Item

When does is it written to xDB Like the other answers said, it is written when the session closes. The time it takes to be written is in the web.config, in the session config. In the xml below, it is ...
Chris Auer's user avatar
  • 13.1k
3 votes

Compare Goals engagement Points in Personalization rules in Sitecore

You will require to implement a custom rule as there are no rules OOTB Sitecore that allows the comparison of total engagement value of goals. The current rules about the Sitecore goals are mainly ...
Hishaam Namooya's user avatar
3 votes

Trigger goal on dynamic item binding

Sitecore 9.x When you call the API, you must remember to include security so that the cookies go with the request. Mainly the analytics cookie. In the code below the GetPageForApi(), if requested, ...
Chris Auer's user avatar
  • 13.1k
3 votes
Accepted

Assign Goals & Events to XDB contact on Submit of Contact-US Form in SItecore 9.1

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(...
Mohit Dharmadhikari's user avatar
2 votes
Accepted

How to trigger a goal programmatically out of web request?

Goal registration heavily relies on the current session. I am not aware of a good way to properly register a goal outside of actual session, page, and request being available. To enroll a contact ...
Dmytro Shevchenko's user avatar
2 votes

Measure engagement on a per product basis

You need to set the goals on the products. Once the user triggers the goal on the product, this is recorded into MongoDB at the user session end. Sitecore stores those data into the PageEvents which ...
Hishaam Namooya's user avatar
2 votes

How to set a goal that only counts two specific pages visited in succession?

There is an easy way to do this by editing the link of your call to action in sitecore. In the querystring value of the link, enter in: sc_trk=goalname (so if your goal is named "LinkAction1" , then ...
YesIRebootedAlready's user avatar
2 votes

Displaying custom event data in Experience Profile

In addition to my blog post Jarmo recommended, I released the code as a Marketplace module you can install into Sitecore to display the Custom Data of the Goal https://marketplace.sitecore.net/...
Jonathan Robbins's user avatar
2 votes
Accepted

How is the top assets by value per visit report actually calculated in Sitecore?

It's the total engagement value attributed to the asset that occurs after site visitors have been exposed to the asset, divided by the number of visits to (exposure to) the asset. The value is ...
James Williamson's user avatar
2 votes

How to check whether goal has been triggered in mongoDB collection

You can use Robo 3T tool. Next example shows how to find goal by name in Interactions collection. db.getCollection('Interactions').find({Pages : {$elemMatch: {PageEvents:{$elemMatch:{Name:'...
Vlad Shpak's user avatar
  • 1,792
2 votes

Refreshing KeyBehaviorCache after triggering a goal

Key behavior cache (KBC) is read-only and is loaded when a session starts. KBC is updated when session is submitted and is not meant to store live data by design. You could try combining it with ...
grg's user avatar
  • 1,811

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