Expand my Community achievements bar.

ttMETA Object Undefined on page reload

Avatar

Level 2

We have a situation where when we reload a page, the ttMETA object is undefined. Why would this happen? If I check the network calls, I get the same thing whether undefined or not.

M_E_J_0-1697232641910.png

Any ideas why this would happen?

 

Thanks,

MJ

5 Replies

Avatar

Community Advisor

Hi @M_E_J - What's the first response when the page is getting loaded in browser, before reload? Are you able to see anything in 

window.ttMETA

 

Avatar

Level 2

Hi,

I get the "ttMETA" object but it is empty. The weird thing is we have a rule that creates it and when debug mode is on, it shows the rule as firing every time, even when the object shows undefined in the console. 

 

The code at the top of the rule:

 

document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function (e) { 
    window.ttMETA= typeof(window.ttMETA)!="undefined" ? window.ttMETA : []; 

 

Another bizarre thing is I can't reproduce the issue when injecting the dev. library. I can only reproduce in production. Here is the URL if you're interested?

 

https://wealth.bmo.com/wealth/onboard/onlineinvesting/#/set-expectation?lang=en

 

You may have to reload a few times to see issue? 

Thanks,

MJ

Avatar

Community Advisor

Hi @M_E_J 

Thank you, I did check the page. QQ - Is any activity live on the page? I can't see anything to be loaded from Target.  

Avatar

Level 2

NO activities currently on that page. You should just get an empty ttMETA object. You shoud try reloading the page a few times, that is usually when you get the error of ttMETA undefined. From my testing it appears that somehow the event listener is either missing the event or something is happening with the timing of the listener? The reason I'm assuming this is due to the code (first 3 lines):

document.addEventListener(adobe.target.event.REQUEST_SUCCEEDED, function(e) {
        _satellite.logger.log("TEST TARGET _satellite.logger.log" + adobe.target.event.REQUEST_SUCCEEDED);
        window.ttMETA = typeof(window.ttMETA) != "undefined" ? window.ttMETA : [];

I should at a minimum get an empty object but this code never runs even though if I test from the console and run adobe.target.event.REQUEST_SUCCEEDED which returns at-request-succeeded even when I get the undefined ttMETA error.

Thanks,

MJ

Avatar

Community Advisor

So in the first line of code the listener is listening for Adobe Target event request succeeded. It means it will return the response in ttMETA only when

REQUEST_SUCCEEDED

and if nothing is live on the page it will only return empty object  like below. 

Gokul_Agiwal_0-1697719018611.png

I would say go with this video and then see if any more questions.