2. Как достичь нужной последовательности? В GTM уже настроено так, что код CE идет перед GA. Triggering rules for Content Experiment script: www.screencast.com/t/m0HZ...
В справке гугла написано developers.google.com/ana... "If you can't guarantee the library load order or that a hit will be sent after the chooseVariation method is called, then you can send another hit to Google Analytics (for example a non-interaction event) to make sure the values are sent."
Имеет ли смысл добавить код события в код Content Experiments? Например так: <!-- Load the JQuery library --> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script> // Define JavaScript for each page variation of this experiment. var pageVariations = [ function() {}, // Original: Do nothing. This will render the default HTML. function() { // Variation 1: Banner Image document.getElementById('banner').src = 'bay-bridge.jpg'; }, function() { // Variation 2: Sub-heading Text document.getElementById('heading').innerHTML = 'Look, a Bridge!'; }, function() { // Variation 3: Button Text document.getElementById('button').innerHTML = 'Learn more'; }, function() { // Variation 4: Button Color document.getElementById('button').className = 'button button-blue'; } ];
// Wait for the DOM to load, then execute the view for the chosen variation. $(document).ready(function(){ // Execute the chosen view pageVariations[chosenVariation] });