Problem/Motivation
There are 3 modules related to Google Optimize:
* https://www.drupal.org/project/d8_google_optimize_hide_page (This module)
* https://www.drupal.org/project/google_optimize/
* https://www.drupal.org/project/google_optimize_js
What is the difference? Which one should I use if I'm using GTM vs not?
Steps to reproduce
NA
Proposed resolution
Discuss/document scenarios here.
Option 1: Use Google Optimize without GTM
In this scenario, use https://www.drupal.org/project/google_optimize/. This will load the Optimize script on the page for you, and optionally the antiflicker script.
TODO: does https://www.drupal.org/project/google_optimize_js do the same thing?
Option 2: Use Google Optimize with GTM
In this scenario, you're loading Optimize on the page using Google Tag Manager (GTM).
However, in all cases you need to load the anti-flicker (page hide) script on the page in the via Drupal to ensure that JavaScript runs early. In this scenario, you would want to use https://www.drupal.org/project/d8_google_optimize_hide_page.
Comments
Comment #2
josephdpurcell commentedI've updated the description. I think there are 2 cases. It's unclear still how google_optimize_js differs.
Comment #3
galactus86 commentedI may be missing something super obvious, but...
What are the steps to setup the A/B part of this? My use case is needing to display 1 of 2 blocks on a single page. How do I set this up so on load it shows one of the two for testing?