amp-html

How do I track multiple Google Optimize experiments in Google AMP?

China☆狼群 提交于 2020-08-26 06:10:20
问题 The amp-experiment docs demonstrate tracking multiple experiments in AMP. However, how do I configure the amp-analytics properly? In the reporting section of the docs, it mentions a VARIANTS placeholder that will be replaced with a serialized list of experiment and variant names. This answer from the Google Optimize team seems to indicate that it could be added to requests in <amp-analytics> like so: <amp-analytics type="googleanalytics"> <script type="application/json"> { "vars": { "account"

How do I link one amp-story-page to another?

為{幸葍}努か 提交于 2020-08-25 07:03:48
问题 So, I'm currently using AMP (amp-story) to make stories, and I'd like to know how can I put a button that switches from one page to another. E.g. a button that makes you go from page 5 to page 8 instead of page 6. The intention is allow the user to skip some of the content. Does the amp-story allow for hidden pages as well (pages that are not accessible unless you press a button)? Most of the events I tried showed me the " _ is not whitelisted " error on the console. Thanks. 回答1: Currently,

amp-experiment info not visible in GA or Google Optimize

岁酱吖の 提交于 2020-08-22 06:45:45
问题 I've implemented a small experiment on an AMP site following this tutorial: https://developers.google.com/optimize/devguides/amp-experiments Here's what I've done: 1. amp-analytics and amp-experiment components <script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script> <script async custom-element="amp-experiment" src="https://cdn.ampproject.org/v0/amp-experiment-0.1.js"></script> 2. Code for the experiment <amp-experiment> <script type=

Conditionally hide or show inputs - AMP

淺唱寂寞╮ 提交于 2020-07-18 05:11:00
问题 I am trying to build a form using Accelerated Mobile Pages (AMP) and I need to hide or show inputs based on user selection. I have a <select> where users can choose the country: <select name="country" id="country" required> <option value="UK">United Kingdom</option> <option value="ES">Spain</option> </select> And if the user chooses United Kingdom I want to hide this inputs: <input type="text" id="idcard" name="idcard"> <input type="text" id="mobile" name="mobile"> I have already tried using

Conditionally hide or show inputs - AMP

送分小仙女□ 提交于 2020-07-18 05:10:19
问题 I am trying to build a form using Accelerated Mobile Pages (AMP) and I need to hide or show inputs based on user selection. I have a <select> where users can choose the country: <select name="country" id="country" required> <option value="UK">United Kingdom</option> <option value="ES">Spain</option> </select> And if the user chooses United Kingdom I want to hide this inputs: <input type="text" id="idcard" name="idcard"> <input type="text" id="mobile" name="mobile"> I have already tried using

Deep-merge with AMP.setState

穿精又带淫゛_ 提交于 2020-07-08 00:39:41
问题 I can't figure out how to overwrite data via AMP.setState. I prepared an example: I have a list of products, output via amp-list. Each product has a 'quantity' value. Each product has two buttons: increase the quantity and decrease it. <!DOCTYPE html> <html amp lang="en"> <head> <meta charset="utf-8" /> <script async src="https://cdn.ampproject.org/v0.js"></script> <script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script> <script async custom

Adding Google Custom Search to AMP site

孤街浪徒 提交于 2020-07-06 11:24:51
问题 I have my Google Custom Search Engine (GCSE) code: <script> (function() { var cx = '008589157460623253837:mhsjluzrngo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> However my Accelerated Mobile Pages (AMP) site does not allow me to add JavaScript to it, and I don't see any AMP components

How to scroll to top in AMP after updating a state on successful form submission?

懵懂的女人 提交于 2020-06-29 06:00:27
问题 I have created a sort functionality in my AMP page,now when I make a request to sort the results and when I update the state after successful form submission the page scroll position remains same. I want the page to scroll to top whenever the state is updated after sorting is done. This is my code: <form method="GET" action="http://localhost:3001/api/v2/<%=@taxonomy%>/<%=@taxon%>" action-xhr="http://localhost:3001/api/v2/<%=@taxonomy%>/<%=@taxon%>" target="_top" on="submit-success: AMP

Google AMP with Laravel

允我心安 提交于 2020-06-09 18:49:31
问题 I have recently launched an ecommerce site based on laravel. And now i really think its a good idea to implement AMP as it supports ecommerce now (even shopify and ebay are implementing it) So my query is how can we implement AMP on laravel? Is there a way to use desktopMainTempalte.blade.php for desktop version and switch to mobileMainTemplate.blade.php on mobile version? I just don't want to create a different domain for mobile device as m.domain.com. I want something creative here but Im

How to construct AMP cookie consent with the help of amp-story-consent?

五迷三道 提交于 2020-06-09 06:01:28
问题 I'd like to add a cookie consent to my AMP static website. I'd like to take advantage of the modal dialog what the amp-story-consent could provide to me. I studied various examples, maybe the most complete is this: https://playground.amp.dev/?url=https%3A%2F%2Fpreview.amp.dev%2Fdocumentation%2Fexamples%2Fuser-consent%2Fstory_user_consent&format=websites (example documentation https://amp.dev/documentation/examples/user-consent/story_user_consent/?referrer=ampbyexample.com) My problem is that