Expand my Community achievements bar.

SOLVED

t.getAttribute error on Adobe Dynamic Tag Manager

Avatar

Level 2

I am trying to figure why the following piece of code generates the "SATELLITE: TypeError - t.getAttribute is not a function". The getElementbyClassName returns an array of object but cannot seem to understand why I get the latter error.

var checkmarks = document.getElementsByClassName('togglePanel
  btn-selector togglePanelCheckmark');

  var currentCheckmark = "";
  // Iterating through all the checkmarks
  for (var i = 0; i < checkmarks.length; i++) {
  var classList = checkmarks[i].classList;
  if(classList.value.indexOf('active') !== -1) {
  currentCheckmark = (checkmarks[i].id.split('-')[2]).split('_')[0] + ':
  ' + checkmarks[i].innerText;
  }
  }
  return currentCheckmark;

Any help would be appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 1

I had the same issue. To create an Event base rule, I copied an existing Event base rule who had the click condition with the Delay link activation checked and changed the condition of that new rule to dataelementchanged. But it did not unchecked the delay link activation checkbox of the previous condition and that's why the error occurred.

Just go into your rule, change the condition to click, uncheck the delay link activation checkbox and change the condition again. It will do the trick

Thanks @aseelund for the inspiration.

View solution in original post

8 Replies

Avatar

Community Advisor

Are you sure you are getting the above said error for this method ? I don't see anything wrong in there ?

Avatar

Level 2

Hello @Veena_07. Thanks for the response. That is what I am thinking also but I am getting the Satellite error everytime I click on a an element with the specified class mentioned above. Any possible workarounds ?

Avatar

Community Advisor

When you get the error in you browser console if you click on the file mentioned in the console it will give you the exact location in the JS where this error is coming. can you locate it ?

Avatar

Level 2

  The error is coming from the Adove Visitor API for Javascript which is on all pages of my site. Here below is just a snippet that was higlighted. I doubt it is a regular Javascript Error, it seems to be related to Adobe (SATELLITE) but can't figure out in what way.

("SATELLITE: "+a)},flush:function(){this.flushed||(O.each(this.messages,function(e){e[2]!==!0&&(this.echo(e[0],e[1]),e[2]=!0)},this),this.flushed=!0)}},O.notify=O.bind(O.Logger.message,O.Logger),O.cleanText=function(e){return null==e?null:O.trim(e).replace(/\s+/g," ")},O.cleanText.legacy=function(e){return null==e?null:O.trim(e).replace(/\s{2,}/g," ").replace(/[^\000-\177]*/g,"")},O.text=function(e){return e.textContent||e.innerText},O.specialProperties={text:O.text,cleanText:function(e){return O.cleanText(O.text(e))}},O.getObjectProperty=function(e,t,n){for(var i,r=t.split("."),s=e,o=O.specialProperties,c=0,l=r.length;l>c;c++){if(null==s)return a;var u=r[c];if(n&&"@"===u.charAt(0)){var d=u.slice(1);s=o[d](s)}else if(s.getAttribute&&(i=u.match(/^getAttribute\((.+)\)$/))){var p=i[1];s=s.getAttribute(p)}else s=s[u]}return s},O.getToolsByType=function(e){if(!e)throw new Error("Tool type is missing");var t=[];for(var a in O.tools)if(O.tools.hasOwnProperty(a)){var n=O.tools[a];n.settings&&n.settings.engine===e&&t.push(n)}return t},O.setVar=function(){var e=O.data.customVars;if(null==e&&(O.data.customVars={},e=O.data.customVars),"string"==typeof arguments[0]){var t=arguments[0];e[t]=arguments[1]}else if(arguments[0]){var a=arguments[0];for(var n in a)a.hasOwnProperty(n)&&(e[n]=a[n])}},O.dataElementSafe=function(e,t){if(arguments.length>2){var a=arguments[2];"pageview"===t?O.dataElementSafe.pageviewCache[e]=a:"session"===t?O.setCookie("_sdsat_"+e,a):"visitor"===t&&O.setCookie("_sdsat_"+e,a,730)}else{if("pageview"===t)return O.dataElementSafe.pageviewCache[e];if("session"===t||"visitor"===t)return O.readCookie("_sdsat_"+e)}},O.dataElementSafe.pageviewCache={},O.realGetDataElement=function(t){var a;return t.selector?O.hasSelector&&O.cssQuery(t.selector,function(e){if(e.length>0){var n=e[0];"text"===t.property?a=n.innerText||n.textContent:t.property in n?a=n[t.property]:O.hasAttr(n,t.property)&&(a=n.getAttribute(t.property))}}):t.queryParam?a=t.ignoreCase?O.getQueryParamCaseInsensitive(t.queryParam):O.getQueryParam(t.queryParam):t.cookie?a=O.readCookie(t.cookie):t.jsVariable?a=O.getObjectProperty(e,t.jsVariable):t.customJS?a=t.customJS():t.contextHub&&(a=t.contextHub()),O.isString(a)&&t.cleanText&&(a=O.cleanText(a)),a},O.getDataElement=function(e,t,n){if(n=n||O.dataElements[e],null==n)return O.settings.undefinedVarsReturnEmpty?"":null;var i=O.realGetDataElement(n);return i===a&&n.storeLength?i=O.dataElementSafe(e,n.storeLength):i!==a&&n.storeLength&&O.dataElementSafe(e,n.storeLength,i),i||t||(i=n["default"]||""),O.isString(i)&&n.forceLowerCase&&(i=i.toLowerCase()),i},O.getVar=function(n,i,r){var s,o,c=O.data.customVars,l=r?r.target||r.srcElement:null,u={uri:O.URI(),protocol:t.location.protocol,hostname:t.location.hostname};if(O.dataElements&&n in O.dataElements)return

Avatar

Level 10

Can you provide the URL and steps to replicate this error?

Avatar

Level 3

The only place i can find t.getAttribute in visitor API is in the method: "linkNeedsDelayActivate"

Do you have "delay link activation" checked for this rule?

1375746_pastedImage_0.png

Avatar

Level 3

I am seeing same issue on our website. Did you find why the issue was happening?

Avatar

Correct answer by
Level 1

I had the same issue. To create an Event base rule, I copied an existing Event base rule who had the click condition with the Delay link activation checked and changed the condition of that new rule to dataelementchanged. But it did not unchecked the delay link activation checkbox of the previous condition and that's why the error occurred.

Just go into your rule, change the condition to click, uncheck the delay link activation checkbox and change the condition again. It will do the trick

Thanks @aseelund for the inspiration.