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

Global area to place code that will fire for any event -- not just when a page load fires

Avatar

Avatar
Boost 5
Level 2
gkopriva
Level 2

Likes

5 likes

Total Posts

4 posts

Correct Reply

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

Avatar
Boost 5
Level 2
gkopriva
Level 2

Likes

5 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
View profile
gkopriva
Level 2

17-06-2014

Today, we have many in page tagging rules which do not require a page load to fire.  I can add code to our s_code or Global rule section but those only fire when a page load is triggered.  I have a need to load variables for every event that occurs and it would be great if either the s_code or global rule section would fire for ANY rule event.  This would eliminate redundant code and make maintaining these rules easier.

2 Comments

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

24-06-2014

One thing I have done to get around this is to define s.doPlugins and put it in the global config custom code section.

 

s.usePlugins=true; s.doPlugins = function(s) { // this stuff will execute every s.t and s.tl call s.prop1='foobar'; // be sure to add your vars to linkTrackVars and linkTrackEvents if s.tl call! if (s.linkType) { s.linkTrackVars='prop1'; } }

Avatar

Avatar
Validate 1
Level 8
thomas_amsler
Level 8

Likes

243 likes

Total Posts

159 posts

Correct Reply

26 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 8
thomas_amsler
Level 8

Likes

243 likes

Total Posts

159 posts

Correct Reply

26 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
thomas_amsler
Level 8

19-06-2018

I fully agree with this. I also have some ideas how to implement it:

  • Have a flag in the Set Variable Action to also include global variables
  • Have a separate Action called something like "Set Global Variables"

We now did something similar to joshd's approach. We have a custom Code JS in our source repo which we add to all the rules that need them via another Set Variable Action Custom Code section.