Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Analytics Champion Program are open!
SOLVED

How to create rule using core extension for eddl ?

Avatar

Level 3

I have written a eddl . How can I trigger rule using only with Core extensions. Or should I need to  write custom code (for example: If the  event name is  "pageview",  then should I need to compare the  value for the event key of each object inside dataLayer and when it  matches with event values as pageview return true.) or should I need to  write separately  dispatchEvent for page view?

.Please  let me know if my understanding is not clear, so that I can understand. 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Any particular reason to implement your own EDDL library? Apart from the Search Discovery extension, Adobe also has its own EDDL implementation "Adobe Client Data Layer" and "Google Data Layer" if you already have the Google data layer implemented and wish to stay with it.

 

Creating your own EDDL could be quite an effort, you need to at least have methods to get the state, reset/consolidate events, and trigger tracking, which is your question.

 

You need to either create a custom extension to populate the "event trigger" method to Adobe Launch so that you can create rules according to events pushed and execute actions. Or you can create event listeners on your EDDL and programmatically hook up with events and run any JavaScript for "action".

View solution in original post

5 Replies

Avatar

Community Advisor

Does it have to be "Core" extension?

 

Search Discovery has a "Data Layer Manager" extension that might work for you... you can specify the name of your data later and the event you are looking for...

 

https://exchange.adobe.com/apps/ec/101462

 

I don't think the Core handles data layer changes well.... so if you can't use an extension, you will probably have to write custom code.

Avatar

Level 3

yes, I want to implement through core not DLM. So, for rules using core extension  , how can I trigger a event using custom code or do I have to use dispatch event .  I feel without an extension the event property inside the datalayer object is useless. Please let me know , how can I do it.

Avatar

Correct answer by
Community Advisor

Any particular reason to implement your own EDDL library? Apart from the Search Discovery extension, Adobe also has its own EDDL implementation "Adobe Client Data Layer" and "Google Data Layer" if you already have the Google data layer implemented and wish to stay with it.

 

Creating your own EDDL could be quite an effort, you need to at least have methods to get the state, reset/consolidate events, and trigger tracking, which is your question.

 

You need to either create a custom extension to populate the "event trigger" method to Adobe Launch so that you can create rules according to events pushed and execute actions. Or you can create event listeners on your EDDL and programmatically hook up with events and run any JavaScript for "action".

Avatar

Community Advisor

Agreed... most of us have never tried to implement our own EDDL.... 

 

I've done custom Data Layers, but as I mentioned in my other post, they are not "event driven"... they are just basic data layers to allow me to get information about the page into one object that I can read and process, but it's not a trigger for rules....

Avatar

Community Advisor

I would say use a custom code block to dispatch the event....

 

You're right, the properties inside the datalayer object is useless if you can't detect when new events are pushed into it.

 

I've never coded an EDDL from scratch... normally I use an extension to listed for dataLayer changes (i.e. I've listened for GTM Data Layer events using the Google Data Layer extension....

 

 

In other scenarios, I am using a data layer, but not an "event based" one... I just have JSON information in an object on the page, then I use either DOM Ready type triggers and read the content of the JSON, or I have our developers dispatch an event that I listen for....

 

I have also dispatched events... but not in the context of an EDDL.

 

 

So to dispatch an event, I am not sure how you should be triggering it (based on the changes to your EDDL.. but you can just create code such as:

var someevent = new Event('someevent');
document.dispatchEvent(someevent);

 

And to create a custom code event listener rule, the rule would look like:

window.addEventListener('someevent', function (e) {
  trigger();
}, false);

 

the "trigger();" part is what tells the rule to proceed to conditions and actions... thus, the rule will fire when "someevent" is dispatched....