Closed alcazes closed 2 years ago
So, it sounds like you want a dynamic custom query parameter data element that would only be functional in custom code, as you would need to pass the parameter key in the function. Correct? We haven't heard this before, as it would be a fairly niche use case that would only be usable in custom code and not via settings.
@alcazes Do you have any extra thoughts from @jeffreywalter 's comment?
@alcazes Hey, we are going to close this issue, please re-open with comments if you would like to discuss this use case.
@jhicken @jeffreywalter
Sorry been busy lately.
Basically I do not need any additional condition, data element or actions to be developed as per say. I just need that existing actions, data element and conditions pass the event
object as part of the module.exports = function(settings, event) {
So instead of using module.exports = function(settings) {
you would add the event
argument to the function like so module.exports = function(settings, event) {
Use case would be when rule is called using DCR with specific payload.
All my private extension pass the event argument which means that if my DCR is called with a payload, I can then configure my data elements to leverage the event details.
This is specifically used on my side as part of the auto-tagging framework that I designed which pass a queued snapshot of the data layer when queued hit is processed. By doing so every condition, data elements and actions that pass the event argument, allows my data elements to return correct data from data layer snapshot.
Also it is used as part of the private extension that I developed to handle ePrivacy and cookie scenarios. If page is loaded without cookie group preference opted in, the rule is queued with a payload that takes a snapshot of the current data element values. When cookie selection is changed and group is opted in then the rule is triggered using a DCR with payload queued at the time. When rule is executed using DCR, all data elements check if event.detail exist and is specific dataElement name exist in payload, if it does it returns it value, if not it continues with normal logic.
So in interface I able to leverage %event.detail.property%
and in custom code I am able to leverage event.detail.property
At the moment it is possible to call a data element using
This is particularly useful with DCR as you can pass metadata and they are passed down to data element where data element support event.
For example custom code support this:
So when called directly like
_satellite.getVar('test', 'xyz')
, xyz will be passed to the custom script and output in console xyz.For some data element no event is passed so it is impossible to pass %event% as value in data element configuration
I believe this is due to the fact event is not passed in queryStringParameter:
I think if the following
module.exports = function(settings) {
is updated tomodule.exports = function(settings, event) {
it would work.This would mean that I could create a queryParam data element and call it as follow:
no need to create multiple data elements for query params, once can be used to retrieve param value as needed.