AMP

amp-smartlinks

Description

Run Narrativ's Linkmate process inside your AMP page

 

Required Scripts

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

Supported Layouts

Overview

At Narrativ, we transform static commerce links into dynamic, multimerchant nodes. With a library of millions of products matched to expert reviews from top commerce publishers, we lift publisher revenue through real-time bidding and data solutions.

This AMP extension is our Linkmate service in AMP. See the full documentation for Linkmate here.

Getting started

Your account must be a member of our Linkmate program to use this feature. For more information about this program, feel free to contact your account manager or hello@narrativ.com.

If you plan to use amp-smartlinks alongside other affiliate partners you will need to specify the meta tag shown below. The tag will specify the order in which the affiliate tags fire.

In your AMP page you will have to add the following snippets:

<!DOCTYPE html>
<html  lang="en">
  <head>
    ...
    <meta
      name="amp-link-rewriter-priorities"
      content="amp-smartlinks amp-other-affiliate"
    />
    <script
      async
      custom-element="amp-smartlinks"
      src="https://cdn.ampproject.org/v0/amp-smartlinks-0.1.js"
    ></script>
    ...
    <script async src="https://cdn.ampproject.org/v0.js"></script>
  </head>
  <body>
    ...
    <amp-smartlinks
      layout="nodisplay"
      nrtv-account-name="supercoolpublisher"
      linkmate
    >
    </amp-smartlinks>
    ...
  </body>
</html>

Attributes

nrtv-account-name Required Your Narrativ account name given to you by your account manager. Need to know your Narrativ account name? Log into dashboard.narrativ.com and go to setup to see your account name in the snippet, or reach out to your account manager for support as needed.
linkmate Optional Flag to run our Linkmate service on an article. Inserting the attribute linkmate in the amp-smartlinks element will run our linkmate service.
exclusive-links Optional Flag to mark links as exclusive. Inserting the attribute exclusive-links in the amp-smartlinks element will generate exclusive links for the article.
link-attribute Optional If you store the "plain" url for a link in a different element attribute than href you can specify so here. Default value: href.
link-selector Optional A CSS selector to get all links you want monetized from an article. Default value: a.

Validation

See amp-smartlinks rules in the AMP validator specification.

Bạn cần được trợ giúp thêm?

Bạn đã đọc tài liệu này hàng chục lần, nhưng nó không thật sự trả lời mọi thắc mắc của bạn? Có lẽ những người khác cũng cảm thấy như vậy: hãy liên hệ với họ trên Stack Overflow.

Truy cập Stack Overflow
Bạn tìm thấy một lỗi hoặc cần bổ sung một tính năng?

Dự án AMP đặc biệt khuyến khích sự tham gia và đóng góp của bạn! Chúng tôi hi vọng bạn sẽ trở thành một người tham gia tích cực trong cộng đồng mã nguồn mở của chúng tôi, nhưng chúng tôi cũng chào mừng các đóng góp đơn lẻ về vấn đề mà bạn đặc biệt quan tâm.

Truy cập GitHub