{"id":3697,"date":"2023-08-31T06:26:53","date_gmt":"2023-08-31T05:26:53","guid":{"rendered":"https:\/\/help.expertsender.com\/?post_type=es&#038;p=3697"},"modified":"2024-03-19T13:23:55","modified_gmt":"2024-03-19T12:23:55","slug":"goal-fulfillment","status":"publish","type":"es","link":"https:\/\/help.expertsender.com\/pl\/emp\/api\/methods\/goal-fulfillment\/","title":{"rendered":"Goal fulfillment"},"content":{"rendered":"\n<p>Goals collection allows marking that a particular subscriber achieved (fulfilled) a particular business goal, such as &#8220;making a purchase&#8221; or &#8220;filling the questionnaire&#8221;.<\/p>\n\n\n\n<p>This could be useful if you wish to use the business goals tracking feature, but cannot use automatic tracking cookie for some reason (e.g. part of business process is outside your website).<\/p>\n\n\n\n<p>For more information about business goals feature, contact our support.<\/p>\n\n\n\n<p>HTTP POST method must be used to send this request.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h.w3eejtqhnfgn_l\"><a href=\"https:\/\/sites.google.com\/expertsender.com\/api-documentation-v2\/methods\/goal-fulfillment?authuser=0#h.w3eejtqhnfgn\"><\/a><a href=\"https:\/\/sites.google.com\/expertsender.com\/api-documentation-v2\/methods\/goal-fulfillment?authuser=0#h.w3eejtqhnfgn\"><\/a><strong>Request data format<\/strong><\/h3>\n\n\n\n<p>Data element children:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Element\/attribute<\/th><th>Type<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td>GoalId<\/td><td>integer<\/td><td>Identifier of business goal. Required<\/td><\/tr><tr><td>GoalValue<\/td><td>integer<\/td><td>Value of achieved business goal. This could be price, number of points etc. If you wish to use other values than integer, convert them first (round, multiply by 100 etc). Default value is 0. Optional.<\/td><\/tr><tr><td>MessageGuid<\/td><td>guid (string)<\/td><td>Unique identifier of single message sent to subscriber. MessageGuid identifies subscriber, message, subscriber list etc.<br><br>This value originates from ExpertSender system and is generated while sending messages. You can pass it to your website by personalizing links in your messages using&nbsp;<code>*[message_guid]*<\/code>&nbsp;tag. Required.<\/td><\/tr><tr><td>Channel<\/td><td>string<\/td><td>Channel which was used to send message to a single subscriber. Optional. Possible values: All, Email, SmsMms, WebPush<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h.s2gxaer5fil4_l\"><strong>Examples<\/strong><\/h3>\n\n\n\n<p>Request:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#A6ACCD;--cbp-line-number-width:16.859375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"POST https:\/\/api.esv2.com\/v2\/Api\/Goals HTTP\/1.1\nAccept-Encoding: gzip,deflate\nContent-Type: application\/xml\nContent-Length: 298\nHost: api.esv2.com\nConnection: Keep-Alive\nUser-Agent: Apache-HttpClient\/4.1.1 (java 1.5)\n\n&lt;ApiRequest xmlns_xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xmlns_xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;\n  &lt;ApiKey&gt;test_api_key1&lt;\/ApiKey&gt;\n  &lt;Data&gt;\n    &lt;GoalId&gt;2&lt;\/GoalId&gt;\n    &lt;GoalValue&gt;123&lt;\/GoalValue&gt;\n    &lt;MessageGuid&gt;C7015756-95F3-4509-8C6C-759FEEC48F91&lt;\/MessageGuid&gt;\n  &lt;\/Data&gt;\n&lt;\/ApiRequest&gt;\" style=\"color:#A6ACCD;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg  style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #A6ACCD\">POST https:\/\/api.esv2.com\/v2\/Api\/Goals HTTP\/1.1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Accept-Encoding: gzip,deflate<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Content-Type: application\/xml<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Content-Length: 298<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Host: api.esv2.com<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Connection: Keep-Alive<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">User-Agent: Apache-HttpClient\/4.1.1 (java 1.5)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">ApiRequest<\/span><span style=\"color: #89DDFF\"> <\/span><span style=\"color: #C792EA\">xmlns<\/span><span style=\"color: #89DDFF\">:<\/span><span style=\"color: #C792EA\">xsi<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">http:\/\/www.w3.org\/2001\/XMLSchema-instance<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #89DDFF\"> <\/span><span style=\"color: #C792EA\">xmlns<\/span><span style=\"color: #89DDFF\">:<\/span><span style=\"color: #C792EA\">xs<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">http:\/\/www.w3.org\/2001\/XMLSchema<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">  <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">ApiKey<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">test_api_key1<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">ApiKey<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">  <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">Data<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">    <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">GoalId<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">2<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">GoalId<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">    <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">GoalValue<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">123<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">GoalValue<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">    <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">MessageGuid<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">C7015756-95F3-4509-8C6C-759FEEC48F91<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">MessageGuid<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">  <\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">Data<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">ApiRequest<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>OK response:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#A6ACCD;--cbp-line-number-width:8.4375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"HTTP\/1.1 201 Created\nCache-Control: private\nServer: Microsoft-IIS\/7.5\nX-AspNetMvc-Version: 3.0\nX-AspNet-Version: 4.0.30319\nX-Powered-By: ASP.NET\nDate: Wed, 17 Apr 2013 11:27:02 GMT\nContent-Length: 0\" style=\"color:#A6ACCD;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg  style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #A6ACCD\">HTTP\/1.1 201 Created<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Cache-Control: private<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Server: Microsoft-IIS\/7.5<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-AspNetMvc-Version: 3.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-AspNet-Version: 4.0.30319<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-Powered-By: ASP.NET<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Date: Wed, 17 Apr 2013 11:27:02 GMT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Content-Length: 0<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Error response (wrong GUID passed):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#A6ACCD;--cbp-line-number-width:16.859375px;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"HTTP\/1.1 400 Bad Request\nCache-Control: private\nContent-Type: text\/xml; charset=utf-8\nServer: Microsoft-IIS\/7.5\nX-AspNetMvc-Version: 3.0\nX-AspNet-Version: 4.0.30319\nX-Powered-By: ASP.NET\nDate: Wed, 24 Apr 2013 11:14:46 GMT\nContent-Length: 239\n\n&lt;ApiResponse xmlns_xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xmlns_xsd=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;\n  &lt;ErrorMessage&gt;\n    &lt;Code&gt;400&lt;\/Code&gt;\n    &lt;Message&gt;Message GUID was not recognized.&lt;\/Message&gt;\n  &lt;\/ErrorMessage&gt;\n&lt;\/ApiResponse&gt;\" style=\"color:#A6ACCD;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg  style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki material-theme-palenight\" style=\"background-color: #292D3E\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #A6ACCD\">HTTP\/1.1 400 Bad Request<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Cache-Control: private<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Content-Type: text\/xml; charset=utf-8<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Server: Microsoft-IIS\/7.5<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-AspNetMvc-Version: 3.0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-AspNet-Version: 4.0.30319<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">X-Powered-By: ASP.NET<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Date: Wed, 24 Apr 2013 11:14:46 GMT<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">Content-Length: 239<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">ApiResponse<\/span><span style=\"color: #89DDFF\"> <\/span><span style=\"color: #C792EA\">xmlns<\/span><span style=\"color: #89DDFF\">:<\/span><span style=\"color: #C792EA\">xsi<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">http:\/\/www.w3.org\/2001\/XMLSchema-instance<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #89DDFF\"> <\/span><span style=\"color: #C792EA\">xmlns<\/span><span style=\"color: #89DDFF\">:<\/span><span style=\"color: #C792EA\">xsd<\/span><span style=\"color: #89DDFF\">=<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #C3E88D\">http:\/\/www.w3.org\/2001\/XMLSchema<\/span><span style=\"color: #89DDFF\">&quot;<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">  <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">ErrorMessage<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">    <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">Code<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">400<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">Code<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">    <\/span><span style=\"color: #89DDFF\">&lt;<\/span><span style=\"color: #F07178\">Message<\/span><span style=\"color: #89DDFF\">&gt;<\/span><span style=\"color: #A6ACCD\">Message GUID was not recognized.<\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">Message<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #A6ACCD\">  <\/span><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">ErrorMessage<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #89DDFF\">&lt;\/<\/span><span style=\"color: #F07178\">ApiResponse<\/span><span style=\"color: #89DDFF\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"author":5,"featured_media":0,"parent":3548,"menu_order":250,"template":"","format":"standard","emp-category":[],"class_list":["post-3697","es","type-es","status-publish","format-standard","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/es\/3697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/es"}],"about":[{"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/types\/es"}],"author":[{"embeddable":true,"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/users\/5"}],"version-history":[{"count":2,"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/es\/3697\/revisions"}],"predecessor-version":[{"id":8831,"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/es\/3697\/revisions\/8831"}],"up":[{"embeddable":true,"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/es\/3548"}],"wp:attachment":[{"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/media?parent=3697"}],"wp:term":[{"taxonomy":"emp-category","embeddable":true,"href":"https:\/\/help.expertsender.com\/pl\/wp-json\/wp\/v2\/emp-category?post=3697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}