ads.js


Notes - Brand -> Campaign -> Teaser

CQ organizes ads:

Brand
└──>Campaign
     └──>Teaser

Fox organizes correspondingly:

Brand (ex. NFL, /content/fsdigital/(NFL|*))
└──>Campaign (ex. Right Rail, /content/campaigns/*)
     └──>Teaser (ex. Coke, Mt. Dew)

multiple teasers may associate with a campaign and multiple campaigns may
associate with a brand.

Segments /etc/segments/:

when segments are defined for teasers they provide extra definition for
display. Use segments to 'show mt dew ads only on the home page', 'prioritize
coca-cola for the right rail', 'exclude sprite from campaign below the top
nav on channel pages'.


Notes - Hard-to-find FS library files

FsPageModel is defined in transitions.js

$ grep -ir --include=*.js fspagemodel ./foxsports
/main_async/source/app/transitions.js:          window.FsPageModel = pageModel;

_g is defined in the file granite_shared_override.js


Notes - Hard-to-find CQ library files

NOTE files w/ CQ defintions used by ads *may only be viewed in crxde.
These files can not be found in the source of the repository.

These files include the following:

/libs/cq/personalization/clientlib/kernel/source/segmentmanager/segmentmanager.js
/libs/cq/personalization/clientlib/kernel/source/shared/clientcontextmanager.js
/libs/cq/personalization/components/clickstreamcloud/clickstreamcloud.jsp

$CQ and CQ_Analytics are defined in the CQ library file kernel.js

http://wem.help.adobe.com/enterprise/en_US/10-0/wem/developing/extending-cq-analytics.html
http://wem.help.adobe.com/enterprise/en_US/10-0/wem/developing/clickstream_cloud.html
http://dev.day.com/docs/en/cq/5-4/developing/clickstream_cloud.html


Notes - About 'CCM'

ClickstreamcloudManager is a legacy object from Day CQ. Adobe renamed it to
ClientContextManager. 'Same object is referenced by CQ_Analytics.CCM


Notes - About Local Testing

good resource for testing the ads
http://local.foxsports.com:4502/content/fsdigital/fscom/nfl.html?wcmmode=disabled

templates that load ads:

apps/*/components/*/advertising/msnAdvertisement/msnAdvertisement.jsp:        require('ads').loadMSNAd(newDivID);
apps/*/components/*/advertising/nativeTeaser/nativeTeaser.jsp:        require('ads').nativeAdInit('<%=properties.get("./redirectURL","")%>','<%=properties.get("./displayNewWindow","")%>','<%=properties.get("./adPosition","4")%>');
apps/*/components/*/advertising/overlayteaserconfig/overlayteaserconfig.jsp:        require('ads').overlayAdInit(<%=frequencyCap%>,<%=hours%>,<%=mins%>,<%=timeout%>);
apps/*/components/*/advertising/ribbonAdvertisement/ribbonAdvertisement.jsp:    require('ads').ribbonAdInit();

templates that initialize ads component

apps/cq/personalization/components/teaser/content.jsp
fscom/components/content/advertising/interstitialTeaser/content.jsp
fscom/components/content/article/articleFooterTeaser/articleFooterTeaser.jsp

this script also inits ads component :(

scripts/main_async/source/app/views/photo.js

Caveats - Pitfalls and Problems, (things that should be fixed)

these make sync calls for the ads templates...
no hook is provided by these. maybe they should be redefined,

foxsports/foxsports-core-ui/src//main/content/jcr_root/apps/fscom/components/content/advertising/interstitialTeaser/content.jsp:    final String TEASER_SUFFIX = "/_jcr_content/par.html";
foxsports/foxsports-core-ui/src//main/content/jcr_root/apps/fscom/components/content/article/articleFooterTeaser/articleFooterTeaser.jsp:    final String TEASER_SUFFIX = "/_jcr_content/par.html";
foxsports/foxsports-core-ui/src//main/content/jcr_root/etc/designs/fsdigital/foxsports/scripts/main_async/source/adengine/CUSTteaser-client.js:        var TEASER_SUFFIX = "/_jcr_content/par.html";

this file defines CQ_Analytics.Utils.load*() and many other methods
tricky file also uses jquery to augment the document in specific ways
possibly the worst script in the application:

apps/fscom/components/content/advertising/clientlib/utils.js

grep for files containing CQCCMObjArr. These are areas of campaign config for the ads
They are edited to push teaser data intended for initializeTeaserLoader() into the
array CQCCMObjArr


Where does dapMgr come from?

'dapMgr':'http://ads1.msads.net/library/dapmsn'