How to control an event firing in tags through custom code... | Community
Skip to main content
Level 2
November 19, 2024
Solved

How to control an event firing in tags through custom code...

  • November 19, 2024
  • 1 reply
  • 697 views

I have a situation with Tags / Launch using the WebSDK where I am making a direct call to a rule for various tl() events for AA.

I'm currently using a series of 3 actions within the rule (for editability more than anything):

  1. Set Variables (GUI for "default values")
  2. Set Custom Variables (custom code)
  3. Send Event

The direct call analyzes my data object which has a specific "event description" that is recognized in the custom code. Unfortunately sometimes my developers make up their own event description that doesn't have an equivalent. Currently this causes an event to still fire, but it's not constructed correctly.  

 

I want to use custom code to check if a valid event description is passed and either stop the entire rule if the event is invalid, or, not allow the send event to happen unless it passes a check. 

I believe the first step would be combining the last two events at a minimum, but I can't figure out what the custom code would be for the "send event" or if an "exit rule" exists.

 

The send is the AEP WebSDK send event with a variable data element and a type set to "Web Webinteraction Link Clicks".

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by bjoern__koth

HI @_paul_s 

that is the point about the WebSDK. There is no "s" instance anymore (should be) since the Web SDK is replacing Adobe Analytics, Target, Visitor Service and Audience Manager. Should you still have the legacy libraries in place, they should for sure be phased out.

 

I think the condition would be the cleanest way to do it. Else, you can put it in your custom code and make an if statement condition out of it

if (validFormat) { // do something }

1 reply

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 19, 2024

Hi @_paul_s 

I think you may just be using the classic AppMeasurement for Adobe Analytics if you are still referring to s.tl() .

Web SDK would look a little different.

 

What would probably make most sense in your case is a condition with a piece of custom code in your rule that checks whether the given data is in the correct format and returns true to trigger the actions. So, basically your event description check as a gate keeper that aborts the rule execution should the format not be as expected.


Do you have an example of your event description in the format how it should look?

Cheers from Switzerland!
_Paul_SAuthor
Level 2
November 19, 2024

Thanks for the response!

 

Sorry, not literally s.tl.  I'm using web AEP Web SDK Send Event to send a Web Interaction Link Click with a data element.

 

I did consider a condition as a possibility, but I was hoping to keep everything in one custom code section.

 

I'm still curious if there is a way to send an event directly through custom code without using the Tags WebSDK AEP send event action.

 

If there is a url that has all of the available custom code functions that are unique to Launch / AEP WebSDK, that would be good enough for me to track down what I need (if it exists).

bjoern__koth
Community Advisor and Adobe Champion
bjoern__kothCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 19, 2024

HI @_paul_s 

that is the point about the WebSDK. There is no "s" instance anymore (should be) since the Web SDK is replacing Adobe Analytics, Target, Visitor Service and Audience Manager. Should you still have the legacy libraries in place, they should for sure be phased out.

 

I think the condition would be the cleanest way to do it. Else, you can put it in your custom code and make an if statement condition out of it

if (validFormat) { // do something }
Cheers from Switzerland!