Get Code : Manual Comms Preference Update

Prerequisites

Integrate

  1. Track a trigger

  2. Copy the below code snippet(s) and integrate it with your system
  3. Replace <customer-id> with a profile identifier from Audience Insights. The identifier can be an ID or any attribute that is defined as a primary or alternate ID in Audience Insights.
      NOTE: when using alternate IDs to identify customers, the system may return multiple results. Should that be the case, the trigger will be dropped and not processed in journeys.
      
                                        var _customer-id = "";
                                        // Function to get User Details
                                        function getUserDetails() {
                                          var Email = $("#Lemail").val();
                                          webapi.safeAjax({
                                            type: "GET",
                                            url: "/_api/contacts?$select=contactid&$filter=emailaddress1 eq '" + Email + "'",
                                            contentType: "application/json",
                                            success: function (data) {
                                              _customer-id = data.value[0].contactid
                                              console.log(_customer-id)
                                            },
                                            error: function (res, status, xhr) {
                                              ;
                                            }
                                          });
                                        },
                                        function track_msdynmkt_manualcommspreferenceupdate_211228920() {
                                            window["msdynmkt"].setUser({ authId: "<_customer-id>"});   //primary or alternate customer ID - see instructions
                                            window["msdynmkt"].trackEvent({
                                                name: "msdynmkt_manualcommspreferenceupdate_211228920", //Trigger title: Manual Comms Preference Update
                                                ingestionKey : "9bef69e7e88e48c1a83f7c18c639e1d5-dcbe4911-3ae1-4c39-b6f5-9eeadda8c5af-6780",
                                                version: "1.0.0" ,
                                          properties: {
                                        "bindingid" : "<replace-with-string-type-value>",
                                        "contactpoint_email" : "<replace-with-email>",
                                        "contactpoint_phone" : "<replace-with-phone>"
                                        }
                                            });
                                        }
                                      
    • The following types are supported for trigger properties:

      • Text
      • Number
      • True or false
      • Date/Time
      • Entity reference