<?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: Triggering Rules with a CustomEvent in Adobe Experience Platform Launch Questions</title>
    <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/452714#M3946</link>
    <description>&lt;P&gt;Does window custom events work now in Adobe Launch?&lt;/P&gt;</description>
    <pubDate>Thu, 19 May 2022 21:44:15 GMT</pubDate>
    <dc:creator>asheth2295</dc:creator>
    <dc:date>2022-05-19T21:44:15Z</dc:date>
    <item>
      <title>Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237739#M2265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Has anyone been able to get this to work?&amp;nbsp; I have code that is firing an event and a rule set up with a CustomEvent trigger listening to it.&amp;nbsp; I have tired all sorts of different combinations with no luck.&amp;nbsp; I wrote a listener by hand and it is getting invoked, so I know the event is being fired.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could never get this to work the way I thought it should in DTM, either, so maybe Adobe and I have different ideas on how to handle events...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have an example or some tips?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 19:40:39 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237739#M2265</guid>
      <dc:creator>jimbSprint</dc:creator>
      <dc:date>2018-01-16T19:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237740#M2266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As an update, I put a breakpoint inside the core launch code (customEvent.js section), and the listener does get executed and the evaluateListener function is called, but my rule is never executed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Jan 2018 20:53:48 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237740#M2266</guid>
      <dc:creator>jimbSprint</dc:creator>
      <dc:date>2018-01-16T20:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237741#M2267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You indicated you were never able to get this to work in DTM. Have you reviewed this document by chance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://helpx.adobe.com/dtm/kb/custom-event.html" title="https://helpx.adobe.com/dtm/kb/custom-event.html"&gt;Use custom events in Adobe DTM&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have and are still having trouble, could you post more info around your customer event and how you've setup your rule? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 20:55:31 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237741#M2267</guid>
      <dc:creator>jantzen_b</dc:creator>
      <dc:date>2018-01-22T20:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237742#M2268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are 3 components to Custom Event handling:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Creating the Custom Event (&lt;SPAN style="color: #909090;"&gt;&lt;EM&gt;latest browser versions use&amp;nbsp; &lt;SPAN style="font-family: 'courier new', courier;"&gt;new CustomEvent(..)&lt;/SPAN&gt;, but you may need to use different syntax if you are looking for extended backwards compatibility&lt;/EM&gt;&lt;/SPAN&gt;)&lt;/LI&gt;&lt;LI&gt;Dispatching (triggering) the Custom Event (&lt;SPAN style="color: #909090;"&gt;&lt;EM&gt;latest browser versions use &lt;SPAN style="font-family: 'courier new', courier;"&gt;elem.dispatchEvent(event)&lt;/SPAN&gt;, but you may need to use different syntax if you are looking for extended backwards compatibility&lt;/EM&gt;&lt;/SPAN&gt;)&lt;/LI&gt;&lt;LI&gt;Listening for the dispatched (triggered) Custom Event (&lt;SPAN style="color: #909090;"&gt;&lt;EM&gt;this is where you attach an event listener to the DOM element, e.g. the rule you setup in DTM or Launch, or using &lt;SPAN style="font-family: 'courier new', courier;"&gt;elem.addEventListener(..)&lt;/SPAN&gt; with javascript&lt;/EM&gt;&lt;/SPAN&gt;)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a &lt;A _jive_internal="true" href="https://forums.adobe.com/message/9933066#9933066"&gt;DTM example&lt;/A&gt;​​ for using Custom Events. Below is a similar basic example for Launch. Both of which work for me. So as &lt;A href="https://experienceleaguecommunities.adobe.com/people/Jantzen.Belliston"&gt;Jantzen.Belliston&lt;/A&gt;​ mentioned, you will need to provide more info about how you've set it up, including the code you use to create and dispatch the custom event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For Launch&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a generic example, similar to the DTM example above, where I create a custom event listener to be attached to the DOM body. And within the Rule, I just do a simple console.log to show my rule triggered and executed something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go to &lt;STRONG&gt;Rules&lt;/STRONG&gt;, and click&amp;nbsp; &lt;STRONG&gt;+ Add Rule&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;Event Configuration&lt;/STRONG&gt;, Select:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Extension:&lt;/STRONG&gt; Core&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Event Type:&lt;/STRONG&gt; Custom Event&lt;/P&gt;&lt;P&gt;(and whatever you want for &lt;STRONG&gt;Name&lt;/STRONG&gt; and &lt;STRONG&gt;Order&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then to the right, add the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Custom Event Type:&lt;/STRONG&gt; MyCustomEvent&lt;/P&gt;&lt;P&gt;Select "specified elements"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Elements matching the CSS selector:&lt;/STRONG&gt; body&lt;/P&gt;&lt;P&gt;(everything else default)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="chrome_2018-02-06_13-49-47 - Copy.png"&gt;&lt;img src="https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/9379i2E81E66F9BB9C41E/image-size/large?v=v2&amp;amp;px=999" role="button" title="chrome_2018-02-06_13-49-47 - Copy.png" alt="chrome_2018-02-06_13-49-47 - Copy.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Next, under the &lt;STRONG&gt;THEN&lt;/STRONG&gt; section, under &lt;STRONG&gt;Actions&lt;/STRONG&gt;, click &lt;STRONG&gt;+ Add&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under &lt;STRONG&gt;Action Configuration&lt;/STRONG&gt;, select:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Extension:&lt;/STRONG&gt; Core&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Action Type:&lt;/STRONG&gt; Custom Code&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Name: &lt;/STRONG&gt;MyCustomEvent Custom Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then to the right, for &lt;STRONG&gt;Language&lt;/STRONG&gt;, select &lt;STRONG&gt;Javascript&lt;/STRONG&gt;, and click &lt;STRONG&gt;&amp;lt;/&amp;gt; Open Editor&lt;/STRONG&gt;.&amp;nbsp; In the code box overlay, add the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15179469358848739 jive_text_macro" data-renderedposition="1233.1875_8_1042_16" jivemacro_uid="_15179469358848739"&gt;&lt;P&gt;console.log('LAUNCH: Custom Code Box: My Custom Code triggered!');&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the top right of the code box overlay, click &lt;STRONG&gt;Save&lt;/STRONG&gt;, then on the bottom right, click &lt;STRONG&gt;Keep Changes&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="chrome_2018-02-06_14-07-46 - Copy.png"&gt;&lt;img src="https://experienceleaguecommunities.adobe.com/t5/image/serverpage/image-id/9380i86A5A9D16E970FD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="chrome_2018-02-06_14-07-46 - Copy.png" alt="chrome_2018-02-06_14-07-46 - Copy.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, click &lt;STRONG&gt;Save&lt;/STRONG&gt; (or &lt;STRONG&gt;Save to Library and Build&lt;/STRONG&gt; if you have a &lt;STRONG&gt;Dev Library&lt;/STRONG&gt; selected in the rule).&amp;nbsp; Finally, you will need to go to the build/approval process to deploy to whatever environment(s) in order for the changes to take effect on your site.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This takes care of point #3 in the beginning, where we listen for the custom event. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In order for the Launch rule to actually trigger&lt;/STRONG&gt;, your site must cover the first 2 points: creating and dispatching the custom event.&amp;nbsp; The pure javascript version of this is just like the DTM example (or in the link Jantzen provided), which may vary depending on how browser backwards compatible your site wants to be. But point is, somewhere on your site, you should have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15179473713018421" data-renderedposition="1792.1875_8_1042_80" jivemacro_uid="_15179473713018421"&gt;&lt;P&gt;// generic example for creating the custom event (point #1)&lt;/P&gt;&lt;P&gt;var MyCustomEvent = new CustomEvent('MyCustomEvent');&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// generic example for dispatching (triggering) the custom event (point #2)&lt;/P&gt;&lt;P&gt;document.querySelector('body').dispatchEvent(MyCustomEvent);&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 20:03:38 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237742#M2268</guid>
      <dc:creator>Josh_Du</dc:creator>
      <dc:date>2018-02-06T20:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237743#M2269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a small addition regarding usage of the CustomEvent constructor: If you need to support Internet Explorer 9 you might want to use initCustomEvent instead: &lt;A href="https://developer.mozilla.org/de/docs/Web/API/CustomEvent/initCustomEvent" title="https://developer.mozilla.org/de/docs/Web/API/CustomEvent/initCustomEvent"&gt;CustomEvent.initCustomEvent() - Web API Referenz | MDN&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 10:19:27 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237743#M2269</guid>
      <dc:creator>Rico_Pfaus</dc:creator>
      <dc:date>2018-08-28T10:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237744#M2270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://experienceleaguecommunities.adobe.com/people/joshd7227840"&gt;joshd7227840&lt;/A&gt; It was very helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 10:56:05 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237744#M2270</guid>
      <dc:creator>divyas28820797</dc:creator>
      <dc:date>2018-09-06T10:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237745#M2271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;window custom events are not working on LAUNCH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2019 17:40:54 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/237745#M2271</guid>
      <dc:creator>susheel</dc:creator>
      <dc:date>2019-01-08T17:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Triggering Rules with a CustomEvent</title>
      <link>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/452714#M3946</link>
      <description>&lt;P&gt;Does window custom events work now in Adobe Launch?&lt;/P&gt;</description>
      <pubDate>Thu, 19 May 2022 21:44:15 GMT</pubDate>
      <guid>https://experienceleaguecommunities.adobe.com/t5/adobe-experience-platform-launch/triggering-rules-with-a-customevent/m-p/452714#M3946</guid>
      <dc:creator>asheth2295</dc:creator>
      <dc:date>2022-05-19T21:44:15Z</dc:date>
    </item>
  </channel>
</rss>

