{"id":15747,"date":"2026-02-11T18:27:18","date_gmt":"2026-02-11T17:27:18","guid":{"rendered":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/"},"modified":"2026-03-19T15:48:25","modified_gmt":"2026-03-19T14:48:25","slug":"implementation-guide-a-b-testing","status":"publish","type":"docs","link":"https:\/\/refinery89.com\/es\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/","title":{"rendered":"Gu\u00eda de Implementaci\u00f3n: Tests A\/B"},"content":{"rendered":"<p>Easily set up a split test between Refinery89&#8217;s Single Tag and a third-party tag. This guide provides a script for running A\/B tests on your website. This script ensures that once a visitor is assigned to either Refinery89 or another party&#8217;s solution, they will consistently be assigned the same solution for the duration of the test (for default 30 days).<\/p>\n<p>&nbsp;<\/p>\n<h2>1. Script Implementation<\/h2>\n<p><span style=\"font-size: 16px;\">Copy and paste the following code block into the &lt;head&gt; section of your website, as high as possible to ensure the ad stack initializes before other page elements.<\/span><\/p>\n<p>&nbsp;<\/p>\n<div class=\"code-block ng-tns-c3022871546-26 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\" data-hveid=\"0\" data-ved=\"0CAAQhtANahgKEwjZh62U-tGSAxUAAAAAHQAAAAAQgwE\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c3022871546-26 ng-star-inserted\">\n<div class=\"code-block\">\n<pre>&lt;script&gt;\r\n\/* A\/B testing script - loads either Refinery89 or competitor script\r\nEdit the 4 variables below and paste this in your site's head*\/\r\n(function () {\r\n\/\/ ===== CONFIGURATION =====\r\nvar R89_SCRIPT_URL = \"https:\/\/tags.refinery89.com\/yoursite.js\";\r\nvar OTHER_SCRIPT_URL = \"https:\/\/example.com\/other-script.js\"; \/\/ Replace with competitor URL\r\nvar COOKIE_DAYS = 30; \/\/ Days to keep user in same variant\r\nvar SPLIT = 0.5; \/\/ Percentage for R89 (0.5 = 50% each)\r\n\r\n\/\/ ===== DO NOT EDIT BELOW =====\r\nfunction _ab_getCookie(n) {\r\nvar m = document.cookie.match(new RegExp(\"(?:^|; )\" + n + \"=([^;]*)\"));\r\nreturn m ? decodeURIComponent(m[1]) : null;\r\n}\r\nfunction _ab_setCookie(n, v, d) {\r\nvar e = new Date(Date.now() + d * 864e5);\r\nvar f = \"; SameSite=Lax\" + (location.protocol === \"https:\" ? \"; Secure\" : \"\");\r\ndocument.cookie = n + \"=\" + v + \"; expires=\" + e.toUTCString() + \"; path=\/\" + f;\r\n}\r\n\r\nvar _ab_v = _ab_getCookie(\"ab_variant\"), _ab_e = _ab_getCookie(\"ab_exp\");\r\nvar _ab_url = new URLSearchParams(location.search).get(\"ab_variant\");\r\nif (_ab_url === \"r89\" || _ab_url === \"other\") _ab_v = _ab_url;\r\n\r\nif (!_ab_v || !_ab_e || Date.now() &gt; parseInt(_ab_e)) {\r\n_ab_v = Math.random() &lt; SPLIT ? \"r89\" : \"other\";\r\n_ab_setCookie(\"ab_variant\", _ab_v, COOKIE_DAYS);\r\n_ab_setCookie(\"ab_exp\", String(Date.now() + COOKIE_DAYS * 864e5), COOKIE_DAYS);\r\n}\r\n\r\nif (document.querySelector('[data-ab-test]')) return;\r\n\r\nvar _ab_s = document.createElement(\"script\");\r\n_ab_s.async = true;\r\n_ab_s.src = _ab_v === \"r89\" ? R89_SCRIPT_URL : OTHER_SCRIPT_URL;\r\n_ab_s.setAttribute(\"data-ab-test\", \"true\");\r\n(document.head || document.getElementsByTagName(\"head\")[0]).appendChild(_ab_s);\r\n\r\nwindow.__AB_VARIANT__ = _ab_v;\r\n})();\r\n&lt;\/script&gt;\r\n<\/pre>\n<\/div>\n<div class=\"code-block cc-15qwbrk\"><\/div>\n<div class=\"sdk-warning\"><strong>Please remember to change refinery89 tag for each site<\/strong>.<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><em>This script ensures user-level persistence via cookies, preventing provider switching during a session. This results in cleaner performance data and maximized revenue by maintaining a stable monetization environment for every visitor.<\/em><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p>The methodology is applied as follows:<\/p>\n<p data-renderer-start-pos=\"2069\" data-local-id=\"94dabb06-4e79-467f-8161-dc1171ead0dc\"><strong>User A is monetized randomly by provider A or B<\/strong><\/p>\n<p>Example 1 \u2013 50\/50 Split<\/p>\n<pre class=\"language-plaintext\"><code>var SPLIT = 0.5; \/\/ 50% R89 \/ 50% alternative <\/code><\/pre>\n<ul>\n<li>Traffic is evenly distributed between Refinery89 and the alternative setup.<\/li>\n<li>Recommended for balanced A\/B testing and clear performance comparison.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>Example 2 \u2013 70\/30 Split<\/p>\n<pre class=\"language-plaintext\"><code>var SPLIT = 0.7; \/\/ 70% R89 \/ 30% alternative <\/code><\/pre>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Majority of traffic is routed to Refinery89.<\/li>\n<li>Useful for controlled rollouts or lower-risk testing.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>During the whole session the User will be monetized through the same solution<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2>2. Configuration Reference<\/h2>\n<table style=\"height: 358px;\" width=\"904\" data-path-to-node=\"16\">\n<thead>\n<tr>\n<td><strong>Variable<\/strong><\/td>\n<td><strong>Description<\/strong><\/td>\n<td><strong>Default \/ Example<\/strong><\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><span data-path-to-node=\"16,1,0,0\"><b data-path-to-node=\"16,1,0,0\" data-index-in-node=\"0\"><code data-path-to-node=\"16,1,0,0\" data-index-in-node=\"0\">R89_SCRIPT_URL<\/code><\/b><\/span><\/td>\n<td>The unique Refinery89 tag for your specific site.<\/td>\n<td><span data-path-to-node=\"16,1,2,0\"><code data-path-to-node=\"16,1,2,0\" data-index-in-node=\"0\">https:\/\/tags.refinery89.com\/yourdomain.js<\/code><\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"16,2,0,0\"><b data-path-to-node=\"16,2,0,0\" data-index-in-node=\"0\"><code data-path-to-node=\"16,2,0,0\" data-index-in-node=\"0\">OTHER_SCRIPT_URL<\/code><\/b><\/span><\/td>\n<td><span data-path-to-node=\"16,2,1,0\">The tag URL for the third-party solution\/provider that is being tested<\/span><\/td>\n<td><span data-path-to-node=\"16,2,2,0\"><code data-path-to-node=\"16,2,2,0\" data-index-in-node=\"0\">https:\/\/competitor.com\/tag.js<\/code><\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"16,3,0,0\"><b data-path-to-node=\"16,3,0,0\" data-index-in-node=\"0\"><code data-path-to-node=\"16,3,0,0\" data-index-in-node=\"0\">COOKIE_DAYS<\/code><\/b><\/span><\/td>\n<td><span data-path-to-node=\"16,3,1,0\">How long the user remains in an assigned group (A or B)<\/span><\/td>\n<td><span data-path-to-node=\"16,3,2,0\"><code data-path-to-node=\"16,3,2,0\" data-index-in-node=\"0\">30<\/code> (Recommended)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span data-path-to-node=\"16,4,0,0\"><b data-path-to-node=\"16,4,0,0\" data-index-in-node=\"0\"><code data-path-to-node=\"16,4,0,0\" data-index-in-node=\"0\">SPLIT<\/code><\/b><\/span><\/td>\n<td><span data-path-to-node=\"16,4,1,0\">Decimal representing the probability of loading Refinery89<\/span><\/td>\n<td><span data-path-to-node=\"16,4,2,0\"><code data-path-to-node=\"16,4,2,0\" data-index-in-node=\"0\">0.5<\/code> (50% Split)<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"featured_media":0,"parent":9875,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-15747","docs","type-docs","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Implementation Guide: A\/B Testing | Refinery89<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refinery89.com\/es\/docs\/preguntas-frecuentes\/onboarding\/implementation-guide-a-b-testing\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implementation Guide: A\/B Testing | Refinery89\" \/>\n<meta property=\"og:description\" content=\"Easily set up a split test between Refinery89&#8217;s Single Tag and a third-party tag. This guide provides a script for running A\/B tests on your website. This script ensures that once a visitor is assigned to either Refinery89 or another party&#8217;s solution, they will consistently be assigned the same solution for the duration of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/refinery89.com\/es\/docs\/preguntas-frecuentes\/onboarding\/implementation-guide-a-b-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"Refinery89\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Refinery89\/\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-19T14:48:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@refinery89\" \/>\n<meta name=\"twitter:label1\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/implementation-guide-a-b-testing\\\/\",\"url\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/implementation-guide-a-b-testing\\\/\",\"name\":\"Implementation Guide: A\\\/B Testing | Refinery89\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/refinery89.com\\\/#website\"},\"datePublished\":\"2026-02-11T17:27:18+00:00\",\"dateModified\":\"2026-03-19T14:48:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/implementation-guide-a-b-testing\\\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/implementation-guide-a-b-testing\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/implementation-guide-a-b-testing\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/refinery89.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FAQs\",\"item\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Publisher Onboardings\",\"item\":\"https:\\\/\\\/refinery89.com\\\/docs\\\/faqs\\\/onboarding\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Implementation Guide: A\\\/B Testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/refinery89.com\\\/#website\",\"url\":\"https:\\\/\\\/refinery89.com\\\/\",\"name\":\"Refinery89\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/refinery89.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/refinery89.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/refinery89.com\\\/#organization\",\"name\":\"Refinery89\",\"alternateName\":\"R89\",\"url\":\"https:\\\/\\\/refinery89.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\\\/\\\/refinery89.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/refinery89.com\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/r89-thumbnail.png\",\"contentUrl\":\"https:\\\/\\\/refinery89.com\\\/wp-content\\\/uploads\\\/2025\\\/08\\\/r89-thumbnail.png\",\"width\":200,\"height\":200,\"caption\":\"Refinery89\"},\"image\":{\"@id\":\"https:\\\/\\\/refinery89.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Refinery89\\\/\",\"https:\\\/\\\/x.com\\\/refinery89\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/refinery89\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@refinery89\",\"https:\\\/\\\/www.instagram.com\\\/refinery_89\\\/\",\"https:\\\/\\\/www.reddit.com\\\/user\\\/Refinery89\\\/\",\"https:\\\/\\\/share.google\\\/K8hFf3ktmUrTi1XCa\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implementation Guide: A\/B Testing | Refinery89","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refinery89.com\/es\/docs\/preguntas-frecuentes\/onboarding\/implementation-guide-a-b-testing\/","og_locale":"es_ES","og_type":"article","og_title":"Implementation Guide: A\/B Testing | Refinery89","og_description":"Easily set up a split test between Refinery89&#8217;s Single Tag and a third-party tag. This guide provides a script for running A\/B tests on your website. This script ensures that once a visitor is assigned to either Refinery89 or another party&#8217;s solution, they will consistently be assigned the same solution for the duration of the [&hellip;]","og_url":"https:\/\/refinery89.com\/es\/docs\/preguntas-frecuentes\/onboarding\/implementation-guide-a-b-testing\/","og_site_name":"Refinery89","article_publisher":"https:\/\/www.facebook.com\/Refinery89\/","article_modified_time":"2026-03-19T14:48:25+00:00","og_image":[{"width":200,"height":200,"url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@refinery89","twitter_misc":{"Tiempo de lectura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/","url":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/","name":"Implementation Guide: A\/B Testing | Refinery89","isPartOf":{"@id":"https:\/\/refinery89.com\/#website"},"datePublished":"2026-02-11T17:27:18+00:00","dateModified":"2026-03-19T14:48:25+00:00","breadcrumb":{"@id":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/implementation-guide-a-b-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/refinery89.com\/"},{"@type":"ListItem","position":2,"name":"FAQs","item":"https:\/\/refinery89.com\/docs\/faqs\/"},{"@type":"ListItem","position":3,"name":"Publisher Onboardings","item":"https:\/\/refinery89.com\/docs\/faqs\/onboarding\/"},{"@type":"ListItem","position":4,"name":"Implementation Guide: A\/B Testing"}]},{"@type":"WebSite","@id":"https:\/\/refinery89.com\/#website","url":"https:\/\/refinery89.com\/","name":"Refinery89","description":"","publisher":{"@id":"https:\/\/refinery89.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refinery89.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Organization","@id":"https:\/\/refinery89.com\/#organization","name":"Refinery89","alternateName":"R89","url":"https:\/\/refinery89.com\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/","url":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","contentUrl":"https:\/\/refinery89.com\/wp-content\/uploads\/2025\/08\/r89-thumbnail.png","width":200,"height":200,"caption":"Refinery89"},"image":{"@id":"https:\/\/refinery89.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Refinery89\/","https:\/\/x.com\/refinery89","https:\/\/www.linkedin.com\/company\/refinery89\/","https:\/\/www.youtube.com\/@refinery89","https:\/\/www.instagram.com\/refinery_89\/","https:\/\/www.reddit.com\/user\/Refinery89\/","https:\/\/share.google\/K8hFf3ktmUrTi1XCa"]}]}},"comment_count":0,"_links":{"self":[{"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/docs\/15747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/comments?post=15747"}],"version-history":[{"count":0,"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/docs\/15747\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/docs\/9875"}],"next":[{"title":"\u00bfC\u00f3mo puedo comenzar a trabajar con Refinery89?","link":"https:\/\/refinery89.com\/es\/docs\/faqs\/onboarding\/how-can-i-start-working-with-refinery89\/","href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/docs\/9876"}],"wp:attachment":[{"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/media?parent=15747"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/refinery89.com\/es\/wp-json\/wp\/v2\/doc_tag?post=15747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}