Event Forwarding: Referencing a data element from within another data element | Community
Skip to main content
Level 3
October 10, 2023
Solved

Event Forwarding: Referencing a data element from within another data element

  • October 10, 2023
  • 1 reply
  • 1663 views
Hi

When using data elements in the tagging part of Data Collection, I am able to use _satellite.getVar("xxx") to reference another data element.

What is the equivalent of this in Event Forwarding?

Usecase: Using Google Ads Enhanced Conversions, I've set up a Secret element for our EMEA organisation, and another one for the NA organisation.  The extension only has room for one Secret, so I've created another data element called "secretChooser" which checks the region coming in on the arc object and then returns the appropriate secret element.  But it is failing on the _satellite.getVar() function call.

 

 

var env = utils.getBuildInfo().environment; var region = arc.event.xdm._polo.region; if (region == 'us') { return _satellite.getVar("googleOAuth2Secret"); } else if(region.match(/(au|tw|my|sg|hk|jp|kr)/) != null) { return ""; } else { //EU access token return _satellite.getVar("emeaGoogleAuthSecret"); }

 

 

And the error message is:

 

Failed to execute "Send Conversion". Failed to execute module for data element "googleAuthSecretChooser". _satellite is not defined 

ReferenceError: Failed to execute "Send Conversion".

Failed to execute module for data element "googleAuthSecretChooser". _satellite is not defined at Object.source (worker.js:2:40457)

 

This doesn't seem to be covered in any documentation that I can find.

 

Thanks
Ben
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 jayakrishnaaparthasarathy

Hi @ben_step  - To access the value of a data element in custom code, use the getDataElementValue method. 
Reference: https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/server/core/overview.html?lang=en#:~:text=the%20Core%20extension.-,Custom%20Code,-Provide%20the%20code 

1 reply

jayakrishnaaparthasarathy
Community Advisor
jayakrishnaaparthasarathyCommunity AdvisorAccepted solution
Community Advisor
October 10, 2023
Ben_StepAuthor
Level 3
October 10, 2023

Perfect, thanks 🙂

Level 2
May 2, 2024

Hello,

Can you please give me the syntax on how to add getDataElementValue in the event forwarding. Say for example I have created "Host' in client side data element.

 

But, how we can refer client side data element "Host" in event forwarding data element. 

Can you kindly guide us with the example. Thanks!