amp-library icon indicating copy to clipboard operation
amp-library copied to clipboard

Missing 'amp-ad extension script' support

Open liluxdev opened this issue 8 years ago • 14 comments

Scripts like this are removed if full html document are passed to amp-library:

<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-latest.js"></script>

But they shouldn't be stripped...

liluxdev avatar Oct 25 '16 10:10 liluxdev

Instead your validator should be updated to generate script dependency as new specs will require it, the official amp validator is saying now:

The tag ‘amp-ad extension .js script’ is missing or incorrect, but required by ‘amp-ad’. This will soon be an error.

liluxdev avatar Oct 25 '16 10:10 liluxdev

The above script tag is also being removed. Any word on when this will be fixed?

ghost avatar Dec 08 '16 21:12 ghost

I have the same issue, hope to get an update soon.

dcfairwi avatar Dec 18 '16 13:12 dcfairwi

https://github.com/Lullabot/amp-library/pull/145 << So I suppose this means the amp-ad script tag isn't required, although the validator warns that it is?

ghost avatar Dec 21 '16 00:12 ghost

It will/can be required soon. Any news about this?

ahilles107 avatar Mar 02 '17 15:03 ahilles107

@ahilles107 #145 has been merged into the code for 23 days now. @creativeprogramming @andrewdresden @dcfairwi can you confirm that this works for you now?

SGudbrandsson avatar Mar 03 '17 14:03 SGudbrandsson

This isnt work unless you patch with composer because composer download the last tag and that is 1.07 and doenst have the code that was merged in master before the tag was created...

When there be another release in the tags?

renzit avatar Mar 07 '17 22:03 renzit

@renzit I just released a new version, 1.1.0.

https://github.com/Lullabot/amp-library/releases/tag/1.1.0

Can you test the new release?

SGudbrandsson avatar Mar 14 '17 13:03 SGudbrandsson

@sigginet i tested the tag 1.1.0 on stage a few hours ago , and now is in production working 100% OK. I was patching the master but now is clean and this are the fix i check: -The amp ad warning -The implementation of amp-sidebar.

So far so good :+1:
Thnks

renzit avatar Mar 14 '17 21:03 renzit

I checked out the latest code from here and also tried 1.1.2 release however on both codes i am getting below error.

tapankumar avatar Aug 16 '17 16:08 tapankumar

Just wanted to confirm that it is working fine with release 1.1.0. Why the same is not implemented on latest releases?

tapankumar avatar Aug 16 '17 16:08 tapankumar

I can confirm, im using amp-ad in production using this library so i can confirm it works. the tag script is added because you have some amp-ad tag in the html, if u add the script hardcoded and you dont have a amp-ad tag the script would be removed...I suspect that, but i need more info

renzit avatar Aug 16 '17 17:08 renzit

@renzit : Thanks for your quick reply.

I got it working with latest release 1.1.2 now.

My HTML was having hard coded script tag like below and i was having amp-ad tag as well.

<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js">

So once firing below command, i was getting above mentioned error.

./amp-console amp:convert faultyamp.html --full-document

So i have removed all scripts (mentioned below) from my HTML and now this php library is adding all required libraries on its own in the head section and working fine.

<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
  <script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
  <script async custom-element="amp-instagram" src="https://cdn.ampproject.org/v0/amp-instagram-0.1.js"></script>

Is this intended behaviors wherein source html should not have amp-ad-0.1.js hard coded?

tapankumar avatar Aug 16 '17 17:08 tapankumar

Hello all! Just a quick up on this: I happen to have an ad script (for Outbrain, FYI) as an amp-embed tag, not an amp-ad tag. Therefore the js head script is stripped as welm. So the fix done before should also include the case of an amp-embed tag, not only amp-ad.

francoispottier avatar Feb 07 '19 16:02 francoispottier