Relevant products:
  • Optimizely X Web Experimentation
  • Optimizely X Web Personalization
  • Optimizely X Web Recommendations

his article will help you:
  • Implement behavioral targeting across different origins (subdomains or protocols) of your site

An “origin” is a combination of a specific hostname, protocol, and port on your site. By default, events that you track in Optimizely can only be used to target changes on the same origin. So when the snippet is running on, it can access events that were generated on, but it cannot access events that were generated on:

What if you want to run an experiment on the secure origin, targeting browsing behavior on the unsecure origin Or what if you want to target based on reading activity on  

You can enable this by navigating to Personalization Settings and clicking on the Implementation tab. There, you can specify origins whose events Optimizely is allowed to pool together.  There are several ways to specify origins:

You can find more information in this article on URL match types.


Want to learn more about origins and the "same-origin policy"? See this Wikipedia article for more examples.

Events are shared asynchronously across origins, so events from are not available when Optimizely first begins to execute on  As a result, behavioral targeting may not succeed until the second page load on

Cross-domain behavioral targeting

Events are targetable across origins only for the current Optimizely User ID, which is stored in the optimizelyEndUserId cookie. Since browsers prevent sharing cookies across domains (e.g., and across top-level domains (e.g.,, Optimizely is unable to set consistent user IDs across such domains.

You will need to manually sync the optimizelyEndUserId cookie across domains, using other means, in order for cross-domain targeting to work.