<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Corrupted JSON response of bserverj in SAS 360 Match</title>
    <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892967#M227</link>
    <description>&lt;P&gt;There is a configuration that can be enabled that would only attach snippets to HTML or Javascript creatives.&amp;nbsp; Please open a support request (&lt;A href="mailto:support@sas.com" target="_blank"&gt;support@sas.com&lt;/A&gt;) and we will resolve your issue there.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2023 15:29:21 GMT</pubDate>
    <dc:creator>BrianJones</dc:creator>
    <dc:date>2023-09-06T15:29:21Z</dc:date>
    <item>
      <title>Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892200#M225</link>
      <description>&lt;P&gt;We've found out that bserverj is clever when working with JSON codes. When creatives are defined as HTML source, response looks like: &lt;FONT face="courier new,courier"&gt;["&amp;lt;p&amp;gt;code one&amp;lt;/p&amp;gt;", "&amp;lt;p&amp;gt;code two&amp;lt;/p&amp;gt;", "etc."]&lt;/FONT&gt;. But when there is JSON, response is not &lt;FONT face="courier new,courier"&gt;["{ \"ad\": \"structure one\" }", "&amp;lt;p&amp;gt;code two&amp;lt;/p&amp;gt;"]&lt;/FONT&gt; as expected, but its &lt;FONT face="courier new,courier"&gt;[{ "ad": "structure one" }, "&amp;lt;p&amp;gt;code two&amp;lt;/p&amp;gt;"]&lt;/FONT&gt; – which is fine! It's nice there is some JSON detection that optimizes away JS structure escaping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there is an error when there are snippets. When there is snippet with code "foo" for type text/html, bserverj returns something like:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;[{ "ad": "structure one" }&lt;FONT color="#FF0000"&gt;foo&lt;/FONT&gt;, "&amp;lt;p&amp;gt;code two&amp;lt;/p&amp;gt;&lt;FONT color="#339966"&gt;foo&lt;/FONT&gt;"]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;... it just pastes that snippet at the end. Result is invalid JSON. We can &lt;EM&gt;maybe&lt;/EM&gt; detect it and parse it away before parsing JSON, but we think it's an obvious error inside bserverj. Could you please acknowledge there is such a bug and maybe even fix it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are few possible fixes:&lt;/P&gt;&lt;P&gt;1. Easiest one is to detect JSON creative after adding snippet, not before... and if the result after adding snippet is not valid JSON, treat it as HTML string (= make JS string).&lt;/P&gt;&lt;P&gt;2. Put snippets inside some JSON field, so there is something like &lt;FONT face="courier new,courier"&gt;{ "ad": "structure", "_sassnippets": ["foo"] }&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;3. When there is creative and some snippets, wrap them in another array, so the response is &lt;FONT face="courier new,courier"&gt;[[{ "ad": "structure one" }, "foo"], "&amp;lt;p&amp;gt;code two&amp;lt;/p&amp;gt;foo"]&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;4. Remove from bserverj all text/html snippets and invent some new way to define application/json snippet (maybe snippet can be JSON too and then you can merge).&lt;/P&gt;&lt;P&gt;5. Remove all snippets from bserverj. That would be unpleasant for us, since we are currently using snippets. Please don't consider doing this &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Sep 2023 00:45:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892200#M225</guid>
      <dc:creator>-MM-</dc:creator>
      <dc:date>2023-09-01T00:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892964#M226</link>
      <description>&lt;P&gt;In case you don't have any plans to fix this, we can create workaround – use some regular expressions to fix your invalid JSON response (wrap our snippet into JSON field) before parsing. But if we do this, we would like to have some guarantees that you really don't have any plans to fix this bug... because fixing it after this could probably break our workaround.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or if you have any other suggestions (are we maybe doing something wrong?), we are all ears. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 15:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892964#M226</guid>
      <dc:creator>-MM-</dc:creator>
      <dc:date>2023-09-06T15:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892967#M227</link>
      <description>&lt;P&gt;There is a configuration that can be enabled that would only attach snippets to HTML or Javascript creatives.&amp;nbsp; Please open a support request (&lt;A href="mailto:support@sas.com" target="_blank"&gt;support@sas.com&lt;/A&gt;) and we will resolve your issue there.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 15:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892967#M227</guid>
      <dc:creator>BrianJones</dc:creator>
      <dc:date>2023-09-06T15:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892975#M228</link>
      <description>&lt;P&gt;Thank you for your response. Our snippet already has MIME type text/html (and creative is application/json). Yet it's attached to bserverj output.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2023 15:46:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/892975#M228</guid>
      <dc:creator>-MM-</dc:creator>
      <dc:date>2023-09-06T15:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/893183#M229</link>
      <description>&lt;P&gt;If I correctly understand your issue, the solution is to add the %%EXTRAHTML%% token to your creative format template. See&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/iapcdc/1.0/iapug/tokens-predefined.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/iapcdc/1.0/iapug/tokens-predefined.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Without the token, the snippet is appended to the end of creative which corrupts the JSON.&lt;/P&gt;&lt;P&gt;When the token is present, the snippet is inserted correctly.&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://optimics-ads.aimatch.com/optimics/bserverj/ball/site=test/area=def/size=exmample-json/afmt=json-snippet" target="_blank" rel="noopener"&gt;https://optimics-ads.aimatch.com/optimics/bserverj/ball/site=test/area=def/size=exmample-json/afmt=json-snippet&lt;/A&gt;&amp;nbsp;which is using this template:&amp;nbsp;{"creativeCode":"%%X_CODE%%","snippet":"%%EXTRAHTML%%"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatejNovakCruxo_1-1694103743714.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87699i9E91F157802B8759/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatejNovakCruxo_1-1694103743714.png" alt="MatejNovakCruxo_1-1694103743714.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatejNovakCruxo_1-1694104258711.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87701iB5DBBF6D1B5981B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatejNovakCruxo_1-1694104258711.png" alt="MatejNovakCruxo_1-1694104258711.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Vs.&amp;nbsp;&lt;A href="https://optimics-ads.aimatch.com/optimics/bserverj/ball/site=test/area=def/size=exmample-json/afmt=json" target="_blank" rel="noopener"&gt;https://optimics-ads.aimatch.com/optimics/bserverj/ball/site=test/area=def/size=exmample-json/afmt=json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;which is using this template:&amp;nbsp;{"creativeCode":"%%X_CODE%%"}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatejNovakCruxo_0-1694103721305.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87698i4CCE8D2D12A30A5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatejNovakCruxo_0-1694103721305.png" alt="MatejNovakCruxo_0-1694103721305.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MatejNovakCruxo_0-1694104234686.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/87700i89528B35DE4A7B58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MatejNovakCruxo_0-1694104234686.png" alt="MatejNovakCruxo_0-1694104234686.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 16:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/893183#M229</guid>
      <dc:creator>MatejNovakCruxo</dc:creator>
      <dc:date>2023-09-07T16:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Corrupted JSON response of bserverj</title>
      <link>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/893203#M230</link>
      <description>&lt;P&gt;Thank you, Pachollini! That's probably the answer I was looking for.&lt;/P&gt;&lt;P&gt;What a pleasant surprise to get this response from you… &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sometimes we don't have JSON in our template but we get it from partner (bidding from Adform).&lt;/P&gt;&lt;P&gt;So we (probably) can't add %%EXTRAHTML:URLENCODED%% inside… but we still need the information from that snippet.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Sep 2023 18:50:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-360-Match/Corrupted-JSON-response-of-bserverj/m-p/893203#M230</guid>
      <dc:creator>-MM-</dc:creator>
      <dc:date>2023-09-07T18:50:41Z</dc:date>
    </item>
  </channel>
</rss>

