Console error - Failed to execute data element module | Community
Skip to main content
Level 3
May 15, 2024
Question

Console error - Failed to execute data element module

  • May 15, 2024
  • 1 reply
  • 1541 views

The data elements are being populated. correctly "_satellite.getVar('Page: Hierarchy Level 1') = index" and error are triggering in console related to data elements why?

 

I got this error message:

Failed to execute data element module gcoe-adobe-client-data-layer/src/lib/dataElements/datalayerComputedState.js for data element Page: Hierarchy Level 1. t.getState is not a function
TypeError: t.getState is not a function

Please refer below screenshot.

 

 

 

 

 

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

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 15, 2024

When you say that the Data Element is populating correctly

 

The data elements are being populated. correctly "_satellite.getVar('Page: Hierarchy Level 1') = index"


Is that when you manually run them in the console?

 

Are those errors happening during the loading of your site... is it possible there is a timing issue, where you are trying to get your hierarchy too soon and it errors out, but by the time you manually run your Satellite getVar code, everything is ready and it works?

 

Have you tried enabling the Satellite Debug Mode?

// Turn on Debugging: _satellite.setDebug(true); // Turn off Debugging: _satellite.setDebug(false);

 

To try and see what rules are firing when and in what order... you could also try adding some additional debugging code in your implementation to try and see what is failing where.

 

 

Level 3
May 15, 2024

Hi @jennifer_dungan , Thanks for the reply 

 

_satellite.setDebug('true')  --> error are populated.

_satellite.setDebug('false')  --> No errors

 

If error are populated for data elements but data is collecting into eVars. How?

 

I noticed after data elements error, [Adobe Client Data Layer] Initializing adobeDataLayer as it wasn't found during the initialization.

 

 

Is this something to do with data elements error?

bjoern__koth
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 15, 2024

HI @reddy_y-11 

interesting, as it seems, you are having the Adobe Client Data Layer extension installed, correct?

As you have pointed out, the automatic initialization of the adobeDataLayer happens later, which is an indication, that at this stage, the underlying page has not yet defined it by itself e.g., there is no such line from your end before the launch script, correct?

 

window.adobeDataLayer = window.adobeDataLayer || [];

 

 

Anyway, the error seems indicate that it is already evaluating a data element before this extension activation has even happened.

 

Is there a URL where this can be looked at?

 

[Update] after checking with @reddy_y-11 , my assumption in

  • Adobe Client Data Layer and Adobe Analytics extensions are installed
  • Analytics is using a global config which is trying to initially set the hierarchy, based on a Data Element which is trying to evaluate the ACDL state
  • by the time the global config is executed, the Adobe Client Data Layer has not yet enriched the "adobeDataLayer" array with additional functionality i.e., a getState function
  • the initialization time of the Adobe Client Data Layer extension is surely too late, but we cannot do anything about this outselves

Approach to circumvent/fix this

  • not recommended: enrich the adobeDataLayer array write your own getState function until it is overwritten by the actual functionality from the extension
  • recommended: defer the AA global initialization data that is relying on the ACDL's computed state to a rule that is executed when the ACDL is receiving data. You can set the event to either "all data changes" or to fire on "specific events"

     

    @reddy_y-11 in the sample URL you sent me, you may want to mark the first data push to the ACDL with a specific event such as "initial_data" and could listen to this to trigger the AA initialization.

 

Cheers

Cheers from Switzerland!