Notes
- If the redirect rule/condition is based on Firmographics (company, industry, location) you can insert the redirect code before the rtp(‘send’, ‘view’) and the rtp(‘get’,‘campaign’) to reduce latency.
- Redirect via JavaScript is a browser side redirect and depends on the website’s loading and optimization to reach maximum speed.
- The best practice is to set the redirect code right after the rtp tag and place it at the header.
- Make sure you’re not running a self redirect (there is a safety net in rtp to block cyclic redirect calls).
<!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 -->