<?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: Implementing custom code using Adobe Launch in Adobe Analytics Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452550#M37391</link>
    <description>&lt;P&gt;This is so very helpful.. Thank you for breaking it down in this way and being detailed. I really appreciate it &lt;img class="lia-deferred-image lia-image-emoji" src="https://experienceleaguecommunities.adobe.com/html/@31B4D6D7B3510763F3CBB2AAB7997408/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; It really helped me in understanding.&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 19:02:36 GMT</pubDate>
    <dc:creator>asheth2295</dc:creator>
    <dc:date>2022-05-18T19:02:36Z</dc:date>
    <item>
      <title>Implementing custom code using Adobe Launch</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452089#M37367</link>
      <description>&lt;P&gt;How can I implement below code using custom code in Adobe Launch?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;script type='text/javascript'&amp;gt;
(function() {
    var oid, total;
    if (typeof digitalData !== 'undefined' &amp;amp;&amp;amp; typeof digitalData.order !== 'undefined') {
        oid = digitalData.order.id;
        total = digitalData.order.total * .965;
    } else {
        oid = 'no order id';
        total = 'no order total';
    }
	var img = document.createElement('img'),
		cjactionid = '361222',
		src="https://www.emjcd.com/u?TYPE=" + cjactionid + "&amp;amp;CID=88888&amp;amp;CURRENCY=USD&amp;amp;OID="+oid+"&amp;amp;AMOUNT="+total+"&amp;amp;METHOD=IMG",
		eid = digitalData_cookie('cjevent'),
		cjevent = (eid) ? "&amp;amp;CJEVENT=" + eid : "";
	img.width = "20";
	img.height = "1";
	img.src=src + cjevent;
	document.body.appendChild(img);
})();
&amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 18:09:50 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452089#M37367</guid>
      <dc:creator>asheth2295</dc:creator>
      <dc:date>2022-05-16T18:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing custom code using Adobe Launch</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452157#M37371</link>
      <description>&lt;P&gt;So here you have an &lt;A href="https://developer.mozilla.org/en-US/docs/Glossary/IIFE" target="_self"&gt;IIFE&lt;/A&gt; so what you can do is take the code inside and put it in an action of a rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see that you are user a data layer layer from the variable digitalData.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is 2 part to this code:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;You set some variables based on data layer values&lt;/LI&gt;&lt;LI&gt;You inject an image tag inside the DOM of your page&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;We will create data elements here to be able to reuse the data and also use some extension based on mapping table to set data based on specific rules. This way you can use same rule on different pages and just update data elements to return correct values.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I would do:&lt;/P&gt;&lt;P&gt;For #1&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create 2 data elements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;One for orderID: use the Core extension JavaScript variable option and paste the path digitalData.order.id&lt;UL&gt;&lt;LI&gt;DO not forget to select default value and set &lt;STRONG&gt;no order id&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;One for orderTotal use the Core extension JavaScript variable option and paste the path digitalData.order.total&lt;UL&gt;&lt;LI&gt;DO not forget to select default value and set&amp;nbsp;&lt;STRONG&gt;no order total&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Notice I did not put the multiplication part here&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;That's it for 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For #2 we will create some additional data elements:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a data element to return you this value:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cjactionid = '361222',​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create data element to return value for&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;eid = digitalData_cookie('cjevent'),​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok now I would configure a rule to fire when you need, I would configure condition to make sure orderId and orderNumber do return a value and just no...&lt;/P&gt;&lt;P&gt;In the action paste this code:&lt;/P&gt;&lt;PRE&gt;var img = document.createElement('img');
img.src=`https://www.emjcd.com/u?TYPE=${_satellite.getVar('cjactionid')}&amp;amp;CID=88888&amp;amp;CURRENCY=USD&amp;amp;OID=${_satellite.getVar('orderId')}&amp;amp;AMOUNT=${_satellite.getVar('orderAmount')}&amp;amp;METHOD=IMG${(_satellite.getVar('eid') ? "&amp;amp;CJEVENT=" + _satellite.getVar('eid') : "")}`;
img.width = "20";
img.height = "1";
document.body.appendChild(img);&lt;/PRE&gt;&lt;P&gt;One rule for your third party product to be fired based on values from data elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 06:59:29 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452157#M37371</guid>
      <dc:creator>Alexis_Cazes_</dc:creator>
      <dc:date>2022-05-17T06:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing custom code using Adobe Launch</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452550#M37391</link>
      <description>&lt;P&gt;This is so very helpful.. Thank you for breaking it down in this way and being detailed. I really appreciate it &lt;img class="lia-deferred-image lia-image-emoji" src="https://experienceleaguecommunities.adobe.com/html/@31B4D6D7B3510763F3CBB2AAB7997408/emoticons/1f642.png" alt=":slightly_smiling_face:" title=":slightly_smiling_face:" /&gt; It really helped me in understanding.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:02:36 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/implementing-custom-code-using-adobe-launch/m-p/452550#M37391</guid>
      <dc:creator>asheth2295</dc:creator>
      <dc:date>2022-05-18T19:02:36Z</dc:date>
    </item>
  </channel>
</rss>

