Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter onnosolin

    (@onnosolin)

    Yeah, it seems once I included <amp-experiment> and <amp-analytics> code, the component script was also included automatically.

    However, I still can’t get it working. I have this code:

    <amp-experiment>
      <script type="application/json">
        {
          "RedirectTestExperiment": {
            "sticky": true,
            "variants": {
              "0": 50,
              "1": 50          
            }
          }
        }
      </script>
    </amp-experiment>
    
    <amp-analytics id="analytics1" type="googleanalytics">
    <script type="application/json">
    {
      "vars": {
        "account": "UA-28755973-8"
      },
      "requests": {
         "experiment": "${pageview}&xid=${xid}&xvar=${xvar}"
      },
      "triggers": {
        "trackPageview": {
          "on": "visible",
          "request": "experiment",
           "vars": {
             "xid": "CdjgjGF0Q6SJY1l-6e0VyQ",
             "xvar": "VARIANT(RedirectTestExperiment)"
           }
        }
      }
    }
    </script>
    </amp-analytics>

    But I keep running into the same error message produced by Google Optimize’s live debugger:

    “The Google Optimize snippet for the container with ID GTM-KD4XQRK is not correctly installed on this page. To preview experiences or debug the container, make sure the Google Optimize snippet is installed on any pages you want to test.”

    Thread Starter onnosolin

    (@onnosolin)

    Sorry, applied wrong markup. Here goes again:
    $( "[src*='https://cdn.ampproject.org/v0/amp-experiment-0.1.js']" );
    results in null

    Thread Starter onnosolin

    (@onnosolin)

    @reneesoffice Would you have any tips for how to test for the automatic inclusion of the script? I’ve tried this in the Google Chrome console for the web page (https://www.onlinecoursewizards.com/page-a/) but it does not seem to yield any results:
    ”$( “[src*=’https://cdn.ampproject.org/v0/amp-experiment-0.1.js’%5D&#8221; );”
    – Result: ”null”

    Thread Starter onnosolin

    (@onnosolin)

    @reneesoffice thanks for your reply.

    Yes, MonsterInsights do claim that their Optimize plugin is compatible:

    “MonsterInsights is the only Analytics WordPress plugin that lets you integrate with Google AMP that also supports Google Optimize.”

    See also: https://www.monsterinsights.com/how-to-add-google-analytics-to-amp-pages-on-wordpress/.

    @albertomedina Thanks for the tip. Yes, I had checked the Optimize documentation. Can’t get past the first step… (Code from first step is removed upon rendering the page in the browser.)

    I’ve opened a separated issue here, thanks.

    I think I’m running into a similar problem. I’m using the AMP plugin (obviously) and MonsterInsights Pro with the Google Analytics and AMP Addons enabled. I’ve set up Google Analytics (tracking fine in both Google Analytics itself and in MonsterInsights), and Google Optimize – which is running fine as long as I deactivate AMP.

    I’ve also installed the “amp-experiments script version rollback” plugin. The ‘add_action’ hook seems to be working – php exits if I put in an exit() statement in the anonymous function inside the add_action call in the php script.

    The problem is that I can’t get Google Optimize to work with AMP enabled. The live debugger for the page where I’m running the experiment (https://www.onlinecoursewizards.com/page-a/) says:

    “The Google Optimize snippet for the container with ID GTM-KD4XQRK is not correctly installed on this page. To preview experiences or debug the container, make sure the Google Optimize snippet is installed on any pages you want to test.”

    If I try to add a tag (in my template’s header.php file) to make sure the Optimize plugin is included:
    <script async custom-element=”amp-experiment”
    src=”https://cdn.ampproject.org/v0/amp-experiment-0.1.js”></script&gt;
    – then the tag is removed from the source code upon rendering the page.

    I was wondering if you’d have any tips to get Google Optimize to play nicely with AMP enabled?

    I have to second this. I’ve registered my domain through https://www.google.com/recaptcha/admin#list, selected the ‘invisible’ site type, and added the keys (site and secret) through the ‘integration’ section.

    My site is showing the invisible recaptcha badge, but the form post does not work. It throws an error: “There was an error trying to send your message. Please try again later.”

    The page is: https://frooxl.com/contact-us/

    The other options are working great, by the way. Thanks for this fantastic plugin!

    Best Regards,
    Onno

Viewing 7 replies - 1 through 7 (of 7 total)