trigger pageload or event rule from script

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

02-05-2018

Is it possible trigger a pageload or event rule from script?

I am aware of the _satellite.track('my-direct-call') syntax, and would like to know if there as an equivalent for pageload/event rules.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

07-05-2018

It is possible to get DTM to re-evaluate  page load and event based rules after page load, but it involves some internal _satellite method calls passing some dummy/rebuilt objects, it is not supported by Adobe for public use, and in practice it won't actually work for you 9/10 times.

Given the current limitations / state of DTM, the best way of doing it is along the lines of what Jantzen.Belliston​ already mentioned.

But in general, one of the benefits of migrating to Launch is that it is a lot more friendly to situations such as yours.

Answers (5)

Answers (5)

Avatar

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Contributor
MVP
joshd7227840
MVP

Likes

275 likes

Total Posts

241 posts

Correct reply

70 solutions
Top badges earned
Contributor
Give Back 10
Give Back 5
Give Back 3
Give Back
View profile
joshd7227840
MVP

07-05-2018

Okay well to be clear..  depending on what the full details/requirements for the tags vs. the site are, you may not have to do a full page refresh to make the tracking trigger. There are alternatives to "refresh the page" and "artificially re-invoke/eval PLRs"!.

For example, Let's say you have a page load rule (PLR) with a condition to output if path is /somepage.html AND if a selected dropdown option value is "bar".  And let's say it is possible for the page to be loaded with "bar" pre-selected, but it's also possible for the dropdown to start with a different option selected.  But you only want the tag to be output if "bar" is selected, be it initial page load or after page load.

You can create your PLR as you have already done. Then, you can create a separate event based rule (EBR) similar to your page load rule conditions, where you set a condition to ensure you are still on the same page /somepage.html, and have the event type be forms > change. The biggest downside to this is having to maintain two separate rules for one tag.

Alternatively, you can leverage an EBR of dataelementchanged type to have a single rule to handle both page load and after page load scenarios, but it's a bit clunkier and potentially not as accurate (depending on site function vs. poll rates). I wouldn't really consider it unless I'm doing a lot of tagging/rules and maintaining duplicate rules for a ton of tags starts to outweigh the the dataelementchanged approach.

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

07-05-2018

Hi Jantzen and Josh,

Thanks for taking the time to help on this.

What you have told me confirms what I was suspecting.

I was hoping to avoid a full page refresh for my solution, but looks like I'll have to do that to retrigger all I need.

Thanks again

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,333 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,333 posts

Correct reply

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

07-05-2018

I'm not aware of a way to specifically call rules, aside from Direct Call Rules.

joshd7227840 - May have some other ideas. He's done a lot of custom work with DTM and often comes up with great solutions for unique scenarios like this.

Avatar

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
davidh97534450
Level 2

Likes

15 likes

Total Posts

11 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
davidh97534450
Level 2

06-05-2018

Hi Jantzen,

One scenario I am trying to work on is:

- A user loads a page, and some of the page load rules don't trigger (IE: due to a custom condition not being met)

- the user interacts with the page and some event rules don't trigger due to a custom condition not being met

- then user changes an option on the page that means the custom condition on previous checks would be met/true.

Is there away to re-call the rules that failed the first pass without having to reload/refresh the entire page?

I was hoping to trigger for a call something like in the handler for the changing of the option:

-----------------------------------------

_satellite.pageTrack('my-page-load-rule-name');//and the same/equivalent for an "event" rule too

----------------------------------------

Avatar

Avatar
Validate 1000
Community Manager
jantzen_belliston-Adobe
Community Manager

Likes

339 likes

Total Posts

2,333 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,333 posts

Correct reply

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

03-05-2018

For pageload, here is a thread where some information was discussed about _satellite.pagebottom()

satllite.pagebottom and satellite.track

As for an event rule, they are typically used in the exact opposite way. An event rule watches for something to happen on the page (including your own custom event), then fires. If you want to trigger an event based rule based on some custom code, I'd suggest firing your own event or using direct call rules. Here is a article that talks about using custom events in DTM

Use custom events in Adobe DTM