web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Code for Custom triggers

(1) ShareShare
ReportReport
Posted on by 274
Hi - does anyone have experience getting a custom trigger to fire via code?
 
I've setup a custom trigger, added to our website via Google Tag Manager, set to fire on certain activities. I can see the tag is firing on the website, but the journeys are not getting started. Here is an example of what I am firing:
 

    function track_msdynmkt_test_092405200() {
        window[/msdynmkt/].setUser({ authId: /test@example.com/});   // ID, e-mail or phone number - see instructions
        window[/msdynmkt/].trackEvent({
            name: /msdynmkt_test_092405200/, //Trigger title: Test - Website Trigger
            ingestionKey : /example-key/,
            version: /1.0.0/ ,
        properties: {
         /bindingid/ : //
        }
        });
    }
 
 
Note the code snippet docs states:
 
Replace <customer-id> with a contact identifier. The identifier can be
  • Unique identifier of contact
  • Email address
  • Phone number (needs to exactly match the number in the customer record, including formatting)
I have tried using contactid, email address for a unique contact - but still nothing seems to come through. Unfortunately doesn't seem to be anyway to debug this either?
I have the same question (0)
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    I have not reproduced your issue in my testing, I embedded the snippet into a static HTML page and it triggered the journey successfully.
     
    The following are the custom trigger.
     
    The code is below.
    When I click the button, it triggers the custom trigger, which triggers the journey.
     
    The response to the web request is as follows.
     
    It is recommended that you check that the MSPI Analytics tag has been added correctly.
    Whether the status code of the web request indicates success.
    Alternatively you can try this in a static HTML page.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
  • jwcpc Profile Picture
    274 on at
    Thanks, Denliang! Yes, I realised I hadn't added the MSPI Analytics tag, will teach me for not reading docs properly. All working now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 214 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 76

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans