文档Marketo 开发人员指南

重定向

Last update: Mon May 05 2025 00:00:00 GMT+0000 (Coordinated Universal Time)
  • 主题:
  • KCS、工作流、Javascript、SSL

创建对象:

  • 管理员

RTP重定向API允许您将分段受众重定向到目标URL。

  • 您必须成为Web Personalization客户,并在您的网站上部署RTP标记,然后才能使用用户上下文API。
  • RTP不支持基于帐户的营销指定帐户列表。 ABM列表和代码仅与在RTP中管理的已上传帐户列表(CSV文件)相关。

使用情况

rtp('send' , 'redirect' , 'field_name' , [ 'values_array' , '...' , '...' ] , 'www.redirect_url.com' , true/false )

参数
可选/必填
类型
描述
'发送'
必需
字符串
方法操作。
'重定向'
必需
字符串
方法名称。
field_name
必需
字符串
要匹配的字段名称。 示例:abm.name(见下文)。
values_array
必需
数组
匹配字段的值列表(不区分大小写)。
redirect_url
必需
字符串
用于重定向符合条件的访客的目标URL。
redirect_matched_visitors
可选
布尔值
如果为true,则将重定向条件匹配的访客。 如果为false,则将重定向不匹配的条件访客。 默认值: true。

组织、行业、 ABM列表、位置、 ISP 、匹配的区段

条件
数据层次结构
示例
匹配区段(仅在首次单击后生效)
matchedSegments.name
rtp( 'send', 'redirect' , 'matchedSegments.name' , ['Fortune 1,000' , 'Enterprise'] , 'http://www.marketo.com');
匹配区段(仅在首次单击后生效)
matchedSegments.id
rtp( 'send', 'redirect' , 'matchedSegments.id' , [106 , 107 , 190] , 'http://www.marketo.com');
ABM列表
abm.name
rtp( 'send', 'redirect' , 'abm.name' , ['top_key_accounts', 'active_customers'] , 'http://www.marketo.com');
ABM列表
abm.code
rtp( 'send', 'redirect', 'abm.code' , [13 , 15] , 'http://www.marketo.com');
组织
org
rtp( 'send', 'redirect', 'org', ['ebay'], 'http://www.marketo.com');
位置
location.country
rtp( 'send', 'redirect', 'location.country', ['United States'], 'http://www.marketo.com');
位置
location.state
rtp( 'send', 'redirect', 'location.state', ['ca'], 'http://www.marketo.com');
位置
location.city
rtp( 'send', 'redirect', 'location.city', ['San Mateo'], 'http://www.marketo.com');
行业
行业
rtp( 'send', 'redirect', 'industries', ['Education'], 'http://www.marketo.com');
ISP
isp
rtp( 'send', 'redirect' , isp , ['False'], 'http://www.marketo.com');

备注

  • 如果重定向规则/条件基于Firmographics(公司、行业、位置),则可以在rtp('send'、'view')和rtp('get'、'campaign')之前插入重定向代码以减少延迟。
  • 通过JavaScript重定向是浏览器端重定向,它取决于网站的加载和优化以达到最大速度。
  • 最佳实践是在rtp标记之后设置重定向代码,并将其放在页眉处。
  • 确保您未运行自重定向(rtp中存在安全网以阻止循环重定向调用)。
<!DOCTYPE html>
<html lang="en-US">
<head>
<!-- RTP tag -->
<script type='text/javascript'>

// This tag needs to be replaced with your account tag
(function(c,h,a,f,i){c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
c[a].a=i;var g=h.createElement("script");g.async=true;g.type="text/javascript";
g.src=f+'?rh='+c.location.hostname+'&aid='+i;var b=h.getElementsByTagName("script")[0];b.parentNode.insertBefore(g,b);
})(window,document,"rtp","//xyz.marketo.com/rtp-api/v1/rtp.js","xyz");

// START REDIRECT EXAMPLE
//   - Using a helper redirect function
//   - Redirect based on named account
rtp('send','redirect','org', ['microsoft'],'http://www.marketo.com');

// Redirect based on named account list (ABM)
rtp('send','redirect','abm.name', {
    // Redirect visitors that match 'first_abm' list to www.marketo.com
    'http://www.marketo.com' : ['first_abm'],
    // Redirect visitors that match 'second_abm' list to blog.marketo.com
    'http://blog.marketo.com' : ['second_abm']
});
// END REDIRECT EXAMPLE
rtp('send','view');
rtp('get','campaign');
</script>
<!-- End of RTP tag -->

如何重定向跟踪的访客

  1. 在目标URL的末尾附加一个参数:即www.marketo.com?rtp=redirect
  2. 创建名为“由RTP重定向”的区段
  3. 使用“特定页面”参数,通过下面显示的参数定位查看任何页面的访客。

跟踪重定向的访客

如何使用不同的目标URL定义多个条件

重定向调用支持多个调用。 这使得使用多个字段进行重定向成为可能,并且还使用不同的URL和值创建复杂的条件。

使用情况

rtp('send', 'redirect', field_name, url_values_map);

参数
可选/必填
类型
描述
'发送'
必需
字符串
方法操作。
'重定向'
必需
字符串
方法名称。
field_name
必需
字符串
要匹配的字段名称。 示例:abm.name(请参阅上文)。
url_values_map
必需
对象
在重定向url和值列表之间映射。 示例:{'http://marketo.com' : ['first_abm', 'second_abm']}

示例

rtp('send','redirect','abm.name', {
    // Redirect visitors that match 'first_abm' list to www.marketo.com
    'http://www.marketo.com' : ['first_abm'],
    // Redirect visitors that match 'second_abm' list to blog.marketo.com
    'http://blog.marketo.com' : ['second_abm']
});
rtp('send','redirect','org', {
    // Redirect visitors from 'Microsoft' to www.marketo.com/enterprise
    'http://www.marketo.com/enterprise' : ['microsoft']
});
recommendation-more-help
bb269a6d-047a-4bf7-9acd-23ad9a63dc59