• Resolved toptenic

    (@toptenic)


    AMP Plugin add 6 ampproject files.
    What is the purpose of each of these files.
    Can i add or delete some js files.
    How can i add or delete some js files.

    • This topic was modified 6 years, 6 months ago by toptenic.
    • This topic was modified 6 years, 6 months ago by toptenic.
Viewing 8 replies - 1 through 8 (of 8 total)
  • @toptenic thanks for your inquiry! Could you share your site URL with us to see which files were added?

    @toptenic The plugin requires the AMP library script along with component scripts to render your URL as AMP valid and for the various tools and functionality those components provide. Examples are Analytics reporting and the lightbox effect on images.

    While there may be methods of programmatically removing the component scripts you’ll encounter validation errors and loss of functionality.

    Thread Starter toptenic

    (@toptenic)

    Thanks for reply
    If i want to add some amp scripts. How can i add scripts, for example for web push notification or for Google Adsense.

    @toptenic If you want to add the amp-web-push component to your site you add the script via the following. You can add that to your active themes functions.php file or to a custom plugin (so it won’t be overwritten). You can add any other components using the same approach.

    add_filter(
      'amp_post_template_data',
       function( $data ) {
        $data['amp_component_scripts'] = array_merge(
         $data['amp_component_scripts'],
          array(
          'amp-web-push' => true,
           )
          );
         return $data;
       }
    );

    The OneSignal push notifications plugin works in AMP with some configuration.

    For AdSense here is a guide for implementing ads on your AMP site. If you want to use Auto ads for AMP you can easily do so using the Site Kit plugin.

    Thread Starter toptenic

    (@toptenic)

    Thanks a lot for helping. Just one question. When i check the site on pingdom told. It shows 13 requests due to amp. can i minimize the request by any chance.

    @toptenic The AMP requests shouldn’t account for any significant time, with all scripts loaded asynchronously. For web performance queries you can use the Webmasters Help Community.

    Thread Starter toptenic

    (@toptenic)

    Ok so many thanks for guiding.

    @toptenic No problem at all. Be sure to leave the plugin a review.

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

The topic ‘adding or deleting some ampproject js files’ is closed to new replies.