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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 3, 2025

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

      June 3, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 3, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 3, 2025

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 2025

      These solid-state fans will revolutionize cooling in our PCs and laptops

      June 3, 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

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025
      Recent

      Community News: Latest PECL Releases (06.03.2025)

      June 3, 2025

      A Comprehensive Guide to Azure Firewall

      June 3, 2025

      Test Job Failures Precisely with Laravel’s assertFailedWith Method

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

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025
      Recent

      All the WWE 2K25 locker codes that are currently active

      June 3, 2025

      PSA: You don’t need to spend $400+ to upgrade your Xbox Series X|S storage

      June 3, 2025

      UK civil servants saved 24 minutes per day using Microsoft Copilot, saving two weeks each per year according to a new report

      June 3, 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

    BitoPro Silent on $11.5M Hack: Investigator Uncovers Massive Crypto Theft

    June 3, 2025
    Security

    New Linux Vulnerabilities

    June 3, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    How to check webservice response in database using Selenium or UFT

    Development

    OpenAI Announces SearchGPT: A Revolutionary AI-Powered Search Engine

    Artificial Intelligence

    Alpine: The Modern jQuery Replacement You’ve Been Waiting For

    Development

    CVE-2025-4659 – Salesforce WordPress Plugin Full Path Disclosure Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    How to find your IP address in any operating system – and why you’d want to

    June 11, 2024

    Need to know the IP address of a machine or device you’re using? Relax. Anyone…

    Using Database Comments to Track Columns With Sensitive Data

    May 8, 2025

    Like Roborock, Dreame is also working on a mechanical arm for its robot vacuums

    January 14, 2025

    Critical MobSF 0-Day Exposes Systems to Stored XSS & ZIP of Death Attacks

    May 6, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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