Wanted to check that we're taking the right steps regarding consent management and the Adobe Target mbox cookie.
We use Google Tag Manager in parallel with OneTrust to suppress analytics and functional cookies, setting the approval/disapproval values as triggers for the relevant tags.
This works fine for all other tags, but Adobe Target (at.js) is hardcoded on the site, not loaded through GTM. So regardless of the value for consent against the mbox cookie within OneTrust, the Target network request has already fired and Target executes.
The solution I've proposed is to prefix at.js with a 'cookie checker' function, which assesses the value of the OneTrust cookie to see if Target is approved, and only then run the full at.js script. Naturally this needs to run not only on page load, but on click of 'Accept all' on the user's landing page within the OneTrust overlay (flicker in this case is a separate issue that we're looking in to).
It seems like a very bespoke solution, so I wanted to ensure there's not a far tidier way given our existing stack.
Has anyone addressed something like this before? How did you deal with it?