Questions tagged [amp-html]
AMP HTML (Accelerated Mobile Pages HTML) is a project to make the web faster as well as easier to develop. It is a set of HTML tags, a JavaScript library, and a cache for AMP-compliant pages.
2,555
questions
-1
votes
0
answers
23
views
How can I make my JavaScript code work in AMP
Here is the JavaScript I want to work in my AMP:
<script type="text/javascript">
atOptions = {
'key' : '86636a40c1b6dd3eeaa4c56ec9c7ba77',
'format' : 'iframe',
...
0
votes
0
answers
35
views
Drupal AMP CSP Error: Refused to load the script because it violates the following Content Security Policy
Any browser continuous throwing the error bellow (7 Errors)
Refused to load the script 'https://cdn.ampproject.org/v0.js' because it violates the following Content Security Policy directive: "...
0
votes
0
answers
38
views
Using onclick in AMP
I have the following which works in HTML:
<a onclick="__tcfapi('displayConsentUi',2, function() {});">Manage Privacy Settings</a>
However, this doesn't work in AMP since scripts ...
0
votes
0
answers
13
views
How do I make changes to ad-network-config.js for AMP?
I'm working with a website that uses AMP and I'm trying to optimize the amp ad insertion.
I saw that I can use the AdConstraintObj and the initialMinSpacing field can help insert content based on ...
1
vote
1
answer
30
views
Result from Google Search from Mobile is missing amp-analytics element
We are facing one issue with the AMP pages coming from Google Search Result in mobile. Google removed <amp-analytics> automatically from the website page and Google Analytics is not able to ...
0
votes
1
answer
38
views
How to do 1 URL re-write rule for multiple ids?
I have these URLs:
https://www.example.com/amp/articles/10/title
https://www.example.com/amp/videos/11/title
I need to redirect only specific ids to non amp as follows:
https://www.example.com/...
0
votes
0
answers
16
views
DomDocument [src] attribute inside an amp-iframe tag
<amp-iframe
layout="fill"
frameborder="0"
sandbox="allow-scripts allow-top-navigation-by-user-activation allow-same-origin allow-forms allow-popups ...
0
votes
0
answers
29
views
AMP authorization delay
I'm experiencing a slowness in AMP when requesting the authorizarionUrl endpoint. The AMP HTML version of the content is taking about 20 seconds to request.
The effect of this for users is that they ...
0
votes
0
answers
17
views
AMP-Email Trigger Json Post API from a form within an email
Newbie here. I am using AMP-EMAIL to make a post API call from a form. I am referring to the code samples mentioned here https://amp.dev/documentation/components/amp-form/?format=email
I am looking ...
0
votes
0
answers
18
views
Add class to amp-carousel-button
I have a carousel created with the amp-carousel component, the amp-carousel-button elements are created as part of the component.
Is there a way to add some classes that I need to do click measurement ...
0
votes
0
answers
42
views
AMP radio input checked not checking
I am trying to check in AMP if radio inputs are checked, but they always return undefined.
This is the html:
<amp-script layout="container" src="url-to-a-js-script.js">
...
0
votes
0
answers
33
views
is AMP not compatible with CSS Grid / Flexbox?
Just done a new lightweight responsive html website in CSS Grid with a bit of flexbox - working perfectly.
Converted a test page (with a bit of everything in it) to AMP, validated in Google DevTools.
...
0
votes
0
answers
23
views
Where to find documentation about AMP script extension versions: module/nomodule .js/.mjs?
The spec for extended components says that:
The script URL must start with https://cdn.ampproject.org and must follow a very strict pattern of /v\d+/[a-z-]+-(latest|\d+|\d+.\d+).js.
I have noticed ...
0
votes
0
answers
28
views
amp-link-rewriter Google AMP
I need your help, is there a way to add multiple amp-link-rewriter tags to a page? I've tried adding a copy, adding an array of data objects, adding a copy of the script tag, and all with no success.
0
votes
1
answer
18
views
A/B Testing an AMP script
I need to test a amp script of an ad (tag < amp-ad >), but in AMP documentation I have only find ways to test style changes between the two versions tested.
Does anyone when through something ...
0
votes
0
answers
22
views
AMP story loading performance
I'm seeing the amp story load slowly both as stand alone and when embedded using amp-story-player. The CSS takes a while to kick in so there's a weird styling for a second or so. Is there something ...
0
votes
0
answers
33
views
How to refresh amp-list that its data is from amp-state
I want to update an amp-list which its data is from amp-state data.
<div>
<amp-script layout="container" script="hello" class="sample" data-ampdevmode>
...
1
vote
0
answers
50
views
Eliminate render-blocking resources font on amp pages
Google Lighthouse raising issues of AMP Pages
I tried multiple solutions but not working
<link rel="preload" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,600,...
0
votes
0
answers
43
views
AMP Pages are not Showing up in Google Search Search
I am am using Official AMP Plugin for my site. I can visit and see the AMP pages by typing https://techsaa.com/?amp or https://techsaa.com/ammp/. There is no validation problem in Google search ...
3
votes
0
answers
657
views
Implement Google Analytics 4 in AMP
I know that GA 4 is still not supported and the development under ID #24621 goes not further. They say GA4 should do the AMP part.
Universal Analytics will stopp at 1st July 2023 and I have a AMP only ...
0
votes
1
answer
70
views
How to create amp-embed that adjusts its height according to the content?
This is similar to this question, but I need to dynamically adjust the height of an amp-embed rather than an amp-frame.
how create AMP iframe adjusts its height according to the content
This page ...
0
votes
0
answers
27
views
i am unable to get the post link out blogger json in amp list
hey guys I am using amp on blogger now i want to use amp list in it but i am not able to get out the post link.
the code I am using
<amp-list binding='no' height='500' id='myAmpList' layout='...
0
votes
0
answers
43
views
amp-carousel 0.2 Safari missing transition
may i ask you to help me understanding why the transition animation for the sliding in an amp-carousel 0.2 is not working on Safari?
How do we reproduce the issue?
Example in playground
open the link ...
0
votes
0
answers
53
views
How to have consistent display with the amp story player
I've been trying to center my amp story player so that when story plays users would be able to see the auto-advance of stories and at the same time be able to pause and play stories. My difficulty now ...
0
votes
0
answers
52
views
Why doesn't animate-in work on a Google AMP web story cover page?
Specifically, I am trying to animate an AMP cover page background image with zoom-out. It works on other pages, but not the first one.
-1
votes
1
answer
32
views
AMP page not loading correctly on IE11
I have an AMP page here:
https://www.homeprotect.co.uk/
The page is built using AMP and is loading perfectly on Chrome, Edge, Firefox but not in IE11
In IE11 the amp-mega-menu doesn't load correctly ...
0
votes
1
answer
108
views
How to remove part of href tag from links using jquery in wordpress
I need to make all html links of my wordpress website dont end in "?amp=1".
For example the link:
<a href="https://example.com/page-1/?amp=1">Page 1</a>
It should ...
1
vote
0
answers
70
views
AMP form method change from POST to GET
I have a AMP page with contact form:
<form method="POST" action-xhr="mail/send.php" target="_top">
As you can see, the method is set to POST. But on my server side ...
1
vote
0
answers
117
views
How to create an svg sprite which supports fragment identifiers?
There are multiple svg icons. To reduce the requests on the page an svg sprite was created to not have a request for every icon. The svg sprite gets lazyloaded via javascript and SVGs of that sprite ...
0
votes
0
answers
25
views
AMP Disqus Iframe not rendering code properly
I once implemented Disqus comments on my AMP blog (Blogger) and it worked perfectly fine. After a while, I noticed that the comment box was no longer displaying correctly.
According to the Disqus ...
1
vote
0
answers
41
views
Is AMP-SCRIPT lowercasing the HTML attributes?
It appears that <amp-script> code lowercases all the dynamically added HTML attributes but that seems to break the viewBox attribute for SVG tags.
For example if you have
document.appendChild('&...
0
votes
1
answer
100
views
AMP Carousel :: Dynamically add item
I am using AMP, Onclick of Add slide, I need to add slide to the carousel dynamically.
Carousel is not working:
jQuery(document).on('click', '#addNewSlide', function(){
jQuery('amp-base-...
0
votes
0
answers
32
views
AMP application process duration
I am working on getting my AMP application. Does anyone know how long the process actually takes and what steps I need to take to complete it? [Edited for better clarification]
0
votes
1
answer
154
views
how to call a function with onclick in AMP page
Trying to call fetch api, on press of an image, it looks I checked AMP events docs but cant help..
amp content looks like below;
const callFetchAPI = () => {
fetch('https://preview.amp.dev/...
0
votes
0
answers
70
views
Render Div based on custom cookie in AMP pages
i need to render a one div based on custom cookie with condition
i have a cookie on different location like asia, africa etc
now i want to render the div based on that location cookie
<div class=&...
0
votes
0
answers
70
views
amp double or multiple range slider
I am new at amp-components is there a way to build a price range component on amp-pages. two pointer on one slider. to set min max value of something.It is a bit old way for put two input box for ...
0
votes
0
answers
32
views
Amp-pixel URL inside mustache gets queried before amp-render is run
I am trying to get an ID from server into amp-pixel. The problem is the pixel URL is queried twice – once with empty cid and once correctly when the template is populated with {{id}} from the server.
...
0
votes
0
answers
20
views
in an amp-story, can I launch the share myself
I am building an amp-story and on one page I have my own share button. If the user taps this button, can I launch the share functionality that exists in the share link at the top of the story?
0
votes
0
answers
53
views
is there a way in an amp-story to have a button or link or end of video advance to the next page?
I am building a story using amp-story and would like to advance the story myself from some thing embedded in the story. For example:
if the video on the story page end playing
if a link on the story ...
0
votes
1
answer
78
views
Is there any way to extract all css classes used in external css file to use in AMP
I have a website like static webpage and its made using tailwincss cdn
and now i want to convert this page in AMP-HTML page
So i want to use the styles of tailwind but not using the external css, as ...
0
votes
0
answers
25
views
How to send input type file value into base64 with AMP?
Is there a way to convert an input type file to base64 when sending it into our endpoint on amp?
I have no idea to do this with amp pages.
<input type='file'>
0
votes
0
answers
46
views
why we can't use <amp-iframe > inside <amp-story-grid-layer>
why we can't use inside tag
and what could be the possible workaround?
My code snippet
<amp-story-grid-layer template="vertical" >
<div class="abc">
&...
0
votes
1
answer
96
views
How to add smooth scrolling to Scroll-To-Top function in amp
here is amp animation scripts i use in my code and h3 tag contains target anchor where is takes refrence of the page to scroll
<h3 class="target">
<a class="target-...
0
votes
1
answer
87
views
How to amp-img Align Right
Simple Question - I'm trying AMP (Accelerated Mobile Pages), but unable to get the image aligned to the right of the text.
<amp-img align="right" width="250" height="250&...
0
votes
0
answers
33
views
Can't move google amp cache to a new subdomain
I am trying to move my amp website to a subdomain and need help. Even though I set my amphtml to my new subdomain on every page, the google amp cache serves me the old site and the new subdomain ...
0
votes
0
answers
93
views
How to add Paypal pay later message on google AMP
How to add paypal pay later message on AMP pages ?
I am using this -
on head
<script async custom-element="amp-script" src="https://cdn.ampproject.org/v0/amp-script-0.1.js">&...
0
votes
0
answers
35
views
magnet links not working , while using the Official AMP WordPress Plugin
I'm using the Official AMP Plugin for my WordPress Blog. I'm using the standard AMP mode as my theme supports it. For some reason, the magnet links are not clickable, while in the editor(Gutenberg) I ...
1
vote
1
answer
65
views
Is there is a way to use Google firebase elements in Google AMP?
I am working on page view count using firebase. It's work perfectly in non amp sites, but I cannot implement in AMP page, it leads to AMP errors
Is there is a way to use Google firebase project ...