05-22-2018 03:10 PM - edited 05-22-2018 03:38 PM
While the utag.gdpr object is instantiated fairly early in utag.js being loaded, utag.gdpr.showExplicityConsent() isn't available until DOM Ready. So if you need to use the function then scope your extension to DOM Ready and it will be injected after the function is declared.
Please let me know if this helps solve your problem.
This still seems like a timing issue. The
utag.gdpr.showExplicitConsent() is instantiated at DOM Ready and you're also attempting to trigger your code at DOM Ready.
It's not directly stated but I presume you added the code to a JS extension, if so scope your extension to DOM Ready (not of All Tags) instead of using the
$(document).ready() wrapper. This will make your extension run after
utag.gdpr.showExplicitConsent() is declared since we handle ordering the function declarations.
05-23-2018 10:10 AM - edited 05-23-2018 10:38 AM
We didn't use the Extension section. After seeing your suggestion, we moved the code to the Extension and it works.
Thank you so much! Wish you a great day! @dan_george
And btw, if we cannot put it in the JS Extension, is there a way to solve this problem?