There are many ways you can implement Adobe Analytics within DTM, and a good answer will vary / be applicable depending on which path you took. If you implemented Adobe Analytics as a Tool, have everything set to Automatic, have done no customizations, etc. then by default DTM does not instantiate the Adobe Analytics s object in the global (window) namespace, but you can still reference it within many of the custom code boxes throughout DTM. So (again, assuming you "out-of-the-boxed Adobe Analytics), below are a few solutions that should work for you.
If the below solutions do not work for you, then you have a more custom AA implementation, so you will need to provide details for how exactly Adobe Analytics is setup within your DTM property.
Solution #1 - Add doPLugins (and the optimizely code) to your AA tool code config
In your Adobe Analytics Tool config, Scroll down to the Customize Page Code section, and click on the Open Editor button.
In the code box, add the following:
s.usePlugins = true;
s.doPlugins = function (s) {
try {
if (window.optimizely && typeof window.optimizely.get === 'function' && window.optimizely.get("custom/adobeIntegrator")) { window.optimizely.get("custom/adobeIntegrator").assignCampaigns(s); }
} catch(e) {window.console&&console.error(e);}
}
Solution #2 - Add the Optimizely code to a Page Load Rule
Go to Rules > Page Load Rules, and click the blue Create New Rule button.
Name the rule something like "Optimizely Config" or whatever your naming convention is.
Scroll down and expand the Adobe Analytics section, and under Custom Page Code, click the Open Page Code button.
In the code box, add your Optimizely code:
try {
if (window.optimizely && typeof window.optimizely.get === 'function' && window.optimizely.get("custom/adobeIntegrator")) { window.optimizely.get("custom/adobeIntegrator").assignCampaigns(s); }
} catch(e) { window.console&&console.error(e);}