Expand my Community achievements bar.

Adobe Target Activities Not Loading Even Though at.js Is Loaded.

Avatar

Level 4

Hi Team,

I am facing an issue with Adobe Target on my AEM page. I am using the at.js file approach (not Adobe Launch). I downloaded the at.js file, added it to a client library, and included it on the page. In the browser console and network tab, I can see that Target is loading correctly, but Activities are not loading.

I also added the <meta name="at_property" content="xxxx" /> tag, and I set the same property in targetPageParams(), but still no change.


Below is the sample code.

<meta name="at_property" content="xxxxx"/>
<script>
window.targetPageParams = function() {
return {
"at_property": "xxxx"
};
};
</script>
<!-- Pre-hiding snippet before loading at.js asynchronously to manage flickering-->
<script>
;(function(win, doc, style, timeout) {
const STYLE_ID = 'at-body-style';

function getParent() {
return doc.getElementsByTagName('head')[0];
}

function addStyle(parent, id, def) {
if (!parent) {
return;
}

const styleTag = doc.createElement('style');
styleTag.id = id;
styleTag.innerHTML = def;
parent.appendChild(styleTag);
}

function removeStyle(parent, id) {
if (!parent) {
return;
}

const styleTag = doc.getElementById(id);

if (!styleTag) {
return;
}

parent.removeChild(styleTag);
}

addStyle(getParent(), STYLE_ID, style);
setTimeout(function() {
removeStyle(getParent(), STYLE_ID);
}, timeout);
}(window, document, "body {opacity: 0 !important}", 3000));
</script>


<script src="/etc.clientlibs/wknd-site/clientlibs/clientlib-adobe-target.lc-6544cf9fe3c838f8c6b96304a987fc51-lc.min.js"></script>


<script>
adobe.target.getOffer({
mbox: "target-global-mbox"
}).then(function(offer) {
adobe.target.applyOffer({ offer: offer });
});
</script>


Could you please help me understand why the activities are not loading and what additional steps or configuration might be missing?

Thanks.

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Reply

Avatar

Employee

Hello @Rudra-2024 

As per below Documentation :
https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/upg...

 

The legacy AEM-driven Experience Targeting integration only works with at.js 1.x. It is not supported with at.js 2.x.

 

If activities are created in Target UI (VEC or form-based):
- You may stay on at.js 2.x
- Do not manually call getOffer on target-global-mbox unless you have disabled the auto page-load global mbox.
- Instead, let at.js auto-create the page-load request, or use:

adobe.target.getOffers({
request: { execute: { pageLoad: {} } }
}).then(function(response) {
return adobe.target.applyOffers({ response: response });
});


- Your at_property setup is conceptually correct, but you must:
> Ensure the value exactly matches the property token in Target.
> Confirm in Network => delivery call that at_property is actually present in the pageLoad parameters.


- A clean baseline that should work:
> Define window.targetPageParams before at.js.
> Load only one copy of at.js, as early as possible in <head>.
> Create a simple A/B activity in Target (Page Load, All visitors, correct property/environment), and test with ?mboxDebug=1.

If activities are created in AEM’s Targeting mode and synced into Target, they rely on the old integration, which is not supported with at.js 2.x and typically only works with at.js 1.x.