How can I trigger a DTM rule when onbeforeunload event happens on site?

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

28-07-2017

Hi,

I have a requirement in which we would like to fire a rule whenever user closes the window. Also, Is there any way if we can listen for other window events which happen on our site through DTM, such as window close, session inactivity et cetra. I understand,  we can make use of direct call rule, triggered from the code base itself, but I am looking for a solution which can be implemented solely on DTM.

Any leads will be greatly appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

14-08-2017

Hi Jantzen, This did help! Thank you so much!

However, we have used event listeners on the website's code base and when ever any event occurs, we listen for this event in the custom JS file (included within page) and trigger direct call rule from this JS.

Answers (7)

Answers (7)

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

14-08-2017

I'm glad you were able to find a solution. Is there an answer you'd like to mark as correct that most helped to answer your original question?

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

14-08-2017

Did the article from Disruptive Advertising help answer your questions?

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

01-08-2017

I'm not really a developer so I wouldn't be able to provide any sample code. I did find a great article from Disruptive Advertising that gives some examples and information though.

http://www.disruptiveadvertising.com/analytics/adobe-dtms-new-custom-and-pushstate-hashchange-event-...

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

31-07-2017

Yes, Let's say, we want to track an event when user closes the window. We can use this using 'onbeforeunload' window function. I was wondering how can we use this event with custom event type from Others section?

Any suggestions?

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

31-07-2017

Yes, the "custom" line listed under the "Other" section of the drop down list will allow you to write your own event handler. I don't believe we have a reference for each of the event handlers that are built into DTM. Is there a particular event handler that you had questions about?

Avatar

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
jayak13010535
Level 2

Likes

4 likes

Total Posts

44 posts

Correct reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
jayak13010535
Level 2

31-07-2017

Hi Jantzen,

Thank you for your quick reply!

Are you referring to 'custom' from Other section in the above image, when you say 'custom' event?

Do you have any link where I can see a description?

Thanks in advance!

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,340 posts

Correct reply

819 solutions
Top badges earned
Validate 1000
Springboard
Validate 500
Validate 250
Validate 100
View profile
jantzen_belliston-Adobe
Community Manager

28-07-2017

The available event triggers built into DTM are listed below:

1267523_pastedImage_0.png

Any events outside of the list above would need to be written using the "custom" event.