Skip to main content

Notifications

Customer Insights - Journeys forum
Answered

Code for Custom triggers

Posted on by 153
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?
  • jwcpc Profile Picture
    jwcpc 153 on at
    Code for Custom triggers
    Thanks, Denliang! Yes, I realised I hadn't added the MSPI Analytics tag, will teach me for not reading docs properly. All working now.
  • Verified answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Code for Custom triggers
    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
     

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

News and Announcements

Forum Structure Changes Coming Soon!

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,734 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,021 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans