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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 48 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans