Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

DTM Custom Event Not Firing

scottc30992367
Level 1
Level 1

I'm using DTM to listen for an event-based rule, named "My Custom Rule". The event type is "custom", as I'm using custom events to track actions from a 3rd party widget. This is my configuration below. It's fairly bland, and I have no conditions (yet). The custom event name is "my-widget-loaded".

Screen Shot 2018-11-10 at 6.45.00 PM.png

Within my 3rd party widget, I trigger my custom event:

document.dispatchEvent(new CustomEvent('my-widget-loaded'));

In the console, I see:

SATELLITE: detected wtb-load on #documentument

But it never fires my rule, I never see a message like:

SATELLITE: Rule "My Custom Rule" fired.

What can I do to make my rule fire? Why isn't it working?

1 Accepted Solution
StewSchilling
Correct answer by
Community Advisor
Community Advisor

Try dispatching it on document.body

document.body.dispatchEvent(new CustomEvent('my-widget-loaded'));

Also, update your rule setting `Element Tag or Selector` to `body`



View solution in original post

1 Reply
StewSchilling
Correct answer by
Community Advisor
Community Advisor

Try dispatching it on document.body

document.body.dispatchEvent(new CustomEvent('my-widget-loaded'));

Also, update your rule setting `Element Tag or Selector` to `body`



View solution in original post