Leared from CR - Double Click

本文档详细介绍了如何在网站中集成DoubleClick广告系统,包括移除特定包含文件、添加自定义脚本逻辑以及根据不同页面类型和频道属性传递参数的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

Requirements - Double Click

 

1.       CASLoginHeader.jsp

Remove the include for CASTopBannerAdhocTextPortlet.jsp

 

Add the script into this JSP, refer to the excel sheet.

 

Ø       If current channel is non-classified channel and search channel, passing “search” to the script

Ø       If current channel is non-calssified channel and not search channel, passing “index” to the script.

Ø       If current channel is classified channel, do the following check:

Get the parameter “vgnextchannel”

If it is null or empty, using current channel to get category (X).

Else, using the passing to find the Channel, if Channel found is not null, get the channel’s category (X).

If X’s parent channel is not classified channel, passing X to the script.

Else, get parent channel’s category (Y) and format it as Y.X

For Y.X, format it again using this format

LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(LOWER(B11)),"","_"),"_&_","_"),",",""),20)

The result of the format will be passed to the script.

 

1.       get classified values from Channel

selectedChannel.getAttribute("channelOption2").getValue()

 

2.       distinguish non-classified channel

            private String categoryTypeValues[] = {

        "", "P", "V", "G"

            };

If selectedChannel.getAttribute("channelOption2").getValue() is null or blank, it is non-classified

 

3.       Search channel

Advance Search”.equals(selectedChannel.getData().getName());

Or "Simple Search".equals(selectedChannel.getData().getName());

 

4.       get vgnextchannel parameter

request.getParameter(“vgnextchannel”);

 

5.       Using vgnextchannel to get Channel

ManagedObjectVCMRef extVCMRef   = new ManagedObjectVCMRef(vgnextchannel);

Channel extChannel = (Channel)Channel.findByContentManagementId(extVCMRef);

 

6.       How to get category of Channel?

It is the channel’s aliasName, if channel’s aliasName is empty, get the channel name.

String chnName = (String)extChannel.getAttribute("channelAliasName").getValue();

If(chnName == null || chnName.trim().length == 0) {

    chnName = extChannel.getData().getName();

}

 

7.       How to get Parent Channel?

Channel parentChannel = extChannel.getParentChannelRef().getChannel();

 

8.       Format category Y.X

    xStr = xStr.trim()

                 .toLowerCase()

                 .replaceAll(" ", "_")

                 .replaceAll("_&_", "_");

 

9.       Parsing Y.X to script

<!-- begin ad tag (tile=1) -->

<script language="JavaScript" type="text/javascript">

category = <%=categoryYX%>

ord=Math.random()*10000000000000000;

document.write('<script language="JavaScript" src="http://ad.hk.doubleclick.net/adj/mc.mocca.com/category;tile=1;dcopt=ist;sz=728x90;ord=' + ord + '?" type="text/javascript"></scr' + 'ipt>');

</script><noscript><a href="http://ad.hk.doubleclick.net/jump/mc.mocca.com/category;tile=1;sz=728x90;ord=123456789?" target="_blank"><img src="http://ad.hk.doubleclick.net/ad/mc.mocca.com/category;tile=1;sz=728x90;ord=123456789?" width="728" height="90" border="0" alt=""></a></noscript><!-- End ad tag -->

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值