How to create Inline amp-addthis in Google AMP ?
Introduction: Some times as a web developer we want to share our social media links and for that, we have to show the social media buttons and amp-addthis is made solely for this purpose. The amp-addthis component integrates the AddThis Floating Bar and Inline Share Buttons.
Setup: You have to import amp-addthis component in your header to use this tag.
Go to this website https://www.addthis.com/register and then create your custom widget which is absolutely free of cost. After filling the details and creating your custom widget you will be directed to a page containing the code. Copy it and paste it into your program code.
- data-pub-id: It is the publisher ID of the publisher of the widget being used.
- data-widget-id: It is the widget ID of the widget being used.
- data-widget-type: This attribute describes the type of widget from floating and inline.
- data-title: It is an optional attribute and it sets the title of the tool. If it is not present then the one present in the documentation will be taken.
- data-url: It is an optional attribute and it is used to set the URL to be shared. If it is not present then the one present in the documentation will be taken.
- data-media: It is an optional attribute use to define the URL of the media to be shared. If it is not present then it is left undefined.
- data-description: It is an optional attribute and used to set the description of the page. If it is not present then it is left undefined.