Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 4, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025

      In Sam Altman’s world, the perfect AI would be “a very tiny model with superhuman reasoning capabilities” for any context

      June 4, 2025

      Sam Altman’s ouster from OpenAI was so dramatic that it’s apparently becoming a movie — Will we finally get the full story?

      June 4, 2025

      One of Microsoft’s biggest hardware partners joins its “bold strategy, Cotton” moment over upgrading to Windows 11, suggesting everyone just buys a Copilot+ PC

      June 4, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      LatAm’s First Databricks Champion at Perficient

      June 4, 2025
      Recent

      LatAm’s First Databricks Champion at Perficient

      June 4, 2025

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025
      Recent

      Players aren’t buying Call of Duty’s “error” excuse for the ads Activision started forcing into the game’s menus recently

      June 4, 2025

      In Sam Altman’s world, the perfect AI would be “a very tiny model with superhuman reasoning capabilities” for any context

      June 4, 2025

      Sam Altman’s ouster from OpenAI was so dramatic that it’s apparently becoming a movie — Will we finally get the full story?

      June 4, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Sitecore Personalize: Triggering Goals Programmatically

    Sitecore Personalize: Triggering Goals Programmatically

    February 19, 2025

    Sitecore Personalize uses goals to track the performance of experiences and experiments.  But what happens if your experience is live and you don’t see any executions or goals tracked in the performance tab for the experience?  It can be hard to debug, test and troubleshoot goal tracking especially if the experience is hidden behind a login for example.  But you can trigger the goal programmatically by making a series of api calls.  I’ve created a Postman collection that you can download to make the process easy!  Just update the environment with the appropriate values and you’ll be able to trigger your goals in no time!

    Pers Triggergoal Postman

    Postman collection details

    Setup the experience

    Pers Triggergoal Goal

    Image showing the custom goal details

    Create your experience using any variant, page targeting and filtering settings.  Expand the goals section and ensure “track performance” is selected, then click Add goals. In this example, I’m using a custom goal. Give your goal a name and set your performance targets. Add the name of your custom event under “track event” and click the save button.

    Make sure to preview your experience to ensure it displays properly.  But keep in mind that an experience must be live in order for the system to track goals.

    Trigger the goal

    In order to trigger a goal in Sitecore Personalize the experience must be viewed in the same session as the goal event.  I’ve setup a postman collection that simulates a user navigating the site, triggering the experience and executing the custom event.

    Pers Triggergoal Sessiondetails

    Session details that match the api calls

    In order to track your guest, you need a browser id (even for api calls).  You can obtain a new browser id by using the “Get Browser Id” call in the postman collection or by using your existing browser id from your browser.  To get your existing browser id, open your browsers dev tools and enter the following command in the console.

    engage.getBrowserId()

    You can update the environment vars in the postman collection to use your existing browser id.

    Once you have your browser id, we will simulate the user journey through the site.  I have included 5 page view calls in the postman collection along with 5 page variables.  Set the urls of the pages you want to call, then execute the VIEW requests.

    After you have made a few view requests, you’ll want to trigger the experience.  You’ll need the friendly id of the experience which can be found on the experience page in the grey details box.  Add this name in the environment variables for the postman collection the run the “Trigger Experience” request.

    Pers Triggergoal Experiencefriendlyid

    Image showing location of friendly id

    Once the experience is triggered, you can trigger your custom event.  Add the custom event name and page url to the environment variables, then execute the “Custom Event” request.

    In this example, we have triggered a goal for an experience using a custom event.  You can just as easily trigger a page view goal by executing a VIEW request to the proper page after triggering your experience.  Similarly, you may want to trigger the identity event if your experience requires the user to log into your site.

    It is important to note that the goal will not appear on the report until the browsing session is closed!  Your point of sale has a timeout period that will close a browsing session after X minutes of inactivity.  When you are testing, you can execute the FORCE CLOSE request to end the session manually.

    Check the data

    Once you have triggered the goal and the session has ended, check the performance and operational data of the experience to validate the goal was triggered properly.  You will see the successful execution of the experience in one graph

    Pers Triggergoal Successfulexecution

    Graph showing successful execution of experience

    and the primary goal in a separate graph.

    Pers Triggergoal Goaltracking After

    Graph showing triggered goal

    You can now be confident that your goal is configured correctly and Sitecore Personalize is tracking your goal correctly.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleThe Ultimate Playground for UX/UI Designers
    Next Article Personalization at Scale: How Adobe & Perficient Are Redefining Digital Experiences

    Related Posts

    Security

    Amazon’s $10 Billion AI Boost: North Carolina Lands Major Tech Expansion!

    June 5, 2025
    Security

    Google Proposes New Browser Security: Your Local Network, Your Permission!

    June 5, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    New SLAP & FLOP Attacks Expose Apple M-Series Chips to Speculative Execution Exploits

    Development

    Elden Ring DLC: How to beat Putrescent Knight in Shadow of the Erdtree

    Development

    Researchers from SynthLabs and Stanford Propose Meta Chain-of-Thought (Meta-CoT): An AI Framework for Improving LLM Reasoning

    Machine Learning

    18 Top Free and Open Source Rust Frontend Web Frameworks

    Development

    Highlights

    Databases

    Unlock PDF Search in Insurance with MongoDB & SuperDuperDB

    June 24, 2024

    As industries go, the insurance industry is particularly document-driven. Insurance professionals, including claim adjusters and…

    Generalization on the Unseen, Logic Reasoning and Degree Curriculum

    November 19, 2024

    NSO Group fined $167M for spyware attacks on 1,400 WhatsApp users

    May 7, 2025

    Test-Time Preference Optimization: A Novel AI Framework that Optimizes LLM Outputs During Inference with an Iterative Textual Reward Policy

    January 28, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.