Project

General

Profile

Actions

Feature #1053

open

Google Optimize for A/B tests

Added by Anonymous over 6 years ago. Updated almost 6 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
12 Jul 2019
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

Данный фрагмент кода скрывает "мерцание" страницы при запуске теста в Google Optimize.

Чтобы его установить:

1. Скопируйте код и добавьте его на каждую страницу сайта сразу после блока <HEAD>, но после любого объявления dataLayer, если оно используется.

2. Убедитесь, что код GTM следует сразу за фрагментом кода Google Optimize

<HTML>
<HEAD>

<style>.async-hide { opacity: 0 !important} </style>
<script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,'async-hide','dataLayer',4000, {'OPT_CONTAINER_ID':true});</script>

Actions

Also available in: Atom PDF