I need to capture the Activity Map "region" whenever the user clicks a link on my site but before the s.tl action is fired. I am aware I can use Processing Rule to copy this value but I need the value client-side. I can see the value in the EC Debugger so I know it's working properly.
The plugins function should be doing the trick, but if not, you could use Object.watch() to determine when the contextData variable changes, then insert your code after that takes place. I found this thread on StackOverflow that might help:
Basically you'll want to figure out exactly when the activity map variable is populated, then you'll be able to insert your own code after that (but before the image request is sent). Bear in mind that this might require inserting code where Adobe says you shouldn't, but hopefully that isn't the case.
Gigazelle - nope, unfortunately that didn't work. I tried all three in the original post inside of the doPlugins and got the following in the console (basically the same as outside of the doPlugins section):