Embed product boxes without WordPress
With an embed key, one script tag and placeholders you show boxes on any HTML page.
For static pages or systems other than WordPress there is embedding: one script tag and placeholders in the HTML. The affiliate links carry the tracking IDs of the website the key belongs to.
Set up
- Under "Websites", open the website and choose the "Embedding" section (visible to owners and admins only).
- In the "Domains" field, enter the domains on which the boxes should appear – one per line or separated by commas.
- Click "Create key".
- Under "Generate code", choose the box type, search for products or choose a list, a product advisor or a product type, and set the box options and appearance. The live preview shows the box with real data.
- In the "Website (HTML)" tab, click "Copy code" and paste the code into your page. Each page needs the script tag only once; further boxes are just further placeholders. The "WordPress", "Ghost" and "Discourse" tabs show the same box as a shortcode.
Generate code – from anywhere in the dashboard
You don't have to switch to the website for this: the "Generate code" dialog is available everywhere in the dashboard – through the button in the sidebar or the shortcut Alt + Shift + E. On the page of a product and a list, "Embed as box" opens it with the product or list already chosen.
- Choose the box type and pick a product, list or product advisor; you set the box options below.
- If you have several websites with a key, you choose the website at the top right – its key then appears in the code. The preview shows the box with your real data (for owners and admins).
- Copy the code in the matching form: "Website (HTML)" with script tag and placeholder, "WordPress" as a shortcode (for example [affilinode_product id="…"]) for posts and pages, "Ghost" or "Discourse".
The dialog is read-only: it creates nothing and changes nothing, which is why it is available to all roles. If you don't have a website with a key yet, it shows the way there; you can still copy the shortcode for WordPress.
The live preview also works before your domain is entered. Views and clicks from the preview count neither toward the quota nor in the statistics.
"example.com" applies with and without www, "*.example.com" for all subdomains. Without a domain, the key works nowhere. The key is in the page source, but it can only read and only works on the approved domains.
Placeholders
<script src="…/embed.js" data-key="YOUR-KEY" async></script>
<div data-affilinode="product" data-id="asin:B0XXXXXXXX"></div>
<div data-affilinode="compare" data-ids="asin:B0XXXXXXXX,asin:B0YYYYYYYY"></div>
<div data-affilinode="list" data-list="<list-ID>"></div>
- With data-id: product (box), compact (row), offers (price comparison), button, card, price-history (price trend, data-days; data-ranges="1" adds a 30/90/365 day switcher), spare-parts, accessories.
- With data-ids: grid (cards side by side) and compare (comparison table, up to 6 products).
- list: best-of list with data-list="<list-ID>" or data-view="<view>".
- picker: comparison picker, readers search themselves; data-type limits it to one product type.
- deals: price drops of best prices, data-type, data-min (minimum savings in %), data-limit and data-filter (only products with certain properties, see below).
- Also with data-id: rating (test rating; data-criteria, data-proscons, data-button="0" hide parts), glance (at a glance; data-count, data-fields), energy (running costs; data-compare, data-years, data-price) and alternatives (data-kinds="cheaper,better,successor", data-limit per kind).
- Without a product: search (product search; data-type, data-facets, data-per-page), advisor (product advisor; data-id = ID of the advisor), compat (compatibility check; data-system="hub:zigbee2mqtt", data-kind, data-product), top (best in category; data-type, data-by="rating|value|field", data-field) and scatter (price-performance chart; data-type, data-field, data-highlight).
- In the middle of a sentence: <span data-affilinode="link" data-id="…"></span> (text link) and <span data-affilinode="field" data-id="…" data-field="price"></span> (single value).
- The attributes are named as in the WordPress plugin, just with data- in front and a hyphen instead of an underscore (per_page → data-per-page). The generator only sets what differs from the default.
- More attributes: data-title (own heading), data-title-style="short|detailed", data-limit.
- Optional on the script tag: data-locale, data-country, data-theme="light|dark|auto", data-accent (color). Without data-locale, the page language from <html lang> applies (Ghost and Discourse set it themselves), without data-country the visitor's country – the language only determines the texts.
Filter deals by properties
The deals box can be limited to products with certain properties – for example only smart home devices that support Matter natively. In the "Generate code" dialog, you enter the filter in the "Attribute filter" field; in the placeholder the attribute is called data-filter, in the shortcode filter.
<div data-affilinode="deals" data-type="smart_plug" data-filter="matter=native"></div>
[affilinode_deals type="smart_plug" filter="matter=native;matter_version=1.3,1.4"]
- Form: property=value. You separate several values of the same property with a comma (one match is enough), several properties with a semicolon (all must match). Example: matter=native;matter_version=1.3,1.4 shows products with native Matter and Matter version 1.3 or 1.4.
- The property is the key of the attribute from the product type's data sheet (for example matter). Possible are selection fields, multiple selection, yes/no (true or false) and numbers as a range (for example 18..36).
- For selection values you may write the key or the label; upper and lower case make no difference.
- Products for which the property is not entered are not shown.
- You can combine the filter with data-type. At most 5 properties and 20 values per property.
- If a key or value is unknown, the box shows nothing. In the sample box (demo key), the filter is not applied.
Deals with price context and your own target page
Each deal can carry a short note that shows why the price is interesting: "Lowest price of the last 90 days" or "€12.50 below the average of other merchants". The note only appears if the recorded prices support it – with too short a price history or fewer than two other merchants with a current price, there is none. Amazon prices never go into the average.
<div data-affilinode="deals" data-best="90" data-min-offers="2" data-link="https://example.org/devices/{id}/"></div>
[affilinode_deals best="90" min_offers="2"]
- data-best (shortcode best): shows only deals whose price was the lowest in the last 7 to 365 days. Without enough price history, a deal does not appear then.
- data-min-offers (shortcode min_offers): shows only deals that are currently available at at least this many merchants (1 to 10).
- data-link: address of your own page per deal, with {id} (product ID) or {gtin}, for example https://example.org/devices/{id}/. The deal's title then leads to this page; the domain must be approved for your embed key, otherwise the box reports an error. If a product has no GTIN, its title stays without a link. The WordPress plugin has no data-link.
- You can set all three in the "Generate code" dialog too.
All other boxes
The other boxes of the WordPress plugin are also available as placeholders – with the same attributes as the shortcodes, as data-… with a hyphen (per_page becomes data-per-page). Their code is only loaded when one of them is on the page; pages with product boxes only stay lean.
<div data-affilinode="search" data-type="smartphone"></div>
<div data-affilinode="advisor" data-id="<advisor-ID>"></div>
<div data-affilinode="compat" data-system="hub:zigbee2mqtt"></div>
<div data-affilinode="alternatives" data-id="asin:B0XXXXXXXX"></div>
<div data-affilinode="top" data-type="smartphone" data-by="rating" data-limit="3"></div>
<div data-affilinode="glance" data-id="asin:B0XXXXXXXX"></div>
<div data-affilinode="scatter" data-type="smartphone" data-field="battery_capacity"></div>
<div data-affilinode="energy" data-id="<ID>" data-compare="<ID>" data-price="35"></div>
<div data-affilinode="rating" data-id="asin:B0XXXXXXXX"></div>
- search: product search with filters (data-type, data-facets, data-per-page, data-view="grid|list", data-scope="site").
- advisor: product advisor from the dashboard, question by question (data-id, data-view).
- compat: "Does this fit my …?" – visitors choose their system; data-system preselects, data-choose="0" without a choice, data-product checks one product.
- alternatives: cheaper, better equipped, successor (data-kinds, data-limit).
- top: best in the category by test score, price-performance or data sheet value (data-type, data-by, data-field, data-view="podium|grid|list", data-badge).
- glance: at a glance – key values with context (data-count, data-fields, data-button="1").
- scatter: price-performance chart (data-type, data-field, data-highlight, data-height, data-table="1").
- energy: running costs by EU energy label, visitors can change the assumptions (data-compare, data-years, data-price in ct/kWh, data-water, data-cycles, data-hours).
- rating: your test rating with score, criteria, pros and cons (data-criteria="0", data-proscons="0", data-button="0").
- coupons: coupons and promotions of the merchants with "Show code" and copying (data-merchant, data-product, data-shop = shop ID, data-kind="code,offer,free_shipping", data-limit up to 50). Below a product box or card: data-coupons="1".
If your account has an Amazon shop, the Amazon rules apply as in the plugin: price-performance and the chart with Amazon prices stay empty, "Cheaper alternative" then just says "Alternative". The browser console shows the reason.
Automatic linking
With data-autolink="1" on the script tag, the script links product names and categories in your page's text – like automatic linking in the WordPress plugin. "products" or "categories" limits it, data-autolink-max the number of links (default 3), data-autolink-shops="amazon,awin" the shops in this order. Categories link to the Amazon search with your tag. Links, headings, code, forms, quotes and elements with the class no-autolink are never linked; you exclude further areas with data-autolink-exclude=".comments, .sidebar" (CSS selector). data-links-scope controls which part of the page is linked (default: .gh-content, .cooked, article, main).
Without writing HTML, it works in the dashboard: for the website under "Embedding", open the "Ghost & forums" tab in the generator and choose "Automatic affiliate links" – products and/or categories, maximum number, shops and areas to exclude. The generator produces a single script tag that you put into the page template (before the closing body tag). This works on any website, not just in Ghost and forums: Amazon links carry only your partner tag and never run through a redirect.
The feature is off by default: the script sends the visible text passages of your page to affilinode – without visitor data and without cookies. affilinode uses the text only for recognition and doesn't store it. Mention this in your privacy policy.
Try it with sample data
No products in the catalog yet? The generator then shows the preview with sample data (switch "With sample data") – even before a key is created. For test pages of your own there is the public key data-key="demo": it works on any domain and supplies invented products, brands and shops (for example data-id="nw-x5" or data-list="smartphones-bestenliste").
The compatibility check (data-affilinode="compat" data-type="smartphone"), the product advisor (data-id="00000000-0000-4000-8000-0000000ad715"), "Best in category" ("top" with data-type="smartphone"), the price-performance chart ("scatter" with data-type="smartphone" data-field="battery"), accessories ("accessories") and contract offers ("contract-offers" with data-id="nw-x5") can be tried with sample data in the same way.
<script src="…/embed.js" data-key="demo" async></script>
<div data-affilinode="product" data-id="nw-x5"></div>
<div data-affilinode="compare" data-ids="nw-x5,lm-pixel-s"></div>
The demo key is for trying things out only: the links go to example.com, there is no commission and no statistics. For your website, use your own key and your own products.
Matching the content (context script)
The "Matching the content (context script)" display finds the products itself: the script reads the title, headings and the beginning of the main text of the page (at most 2,000 characters) and shows matching, available products from your catalog as cards – with the heading "Matching the article", ad label and affiliate note. The main content is read (an element with data-affilinode-content, otherwise article or main); navigation, header and footer areas and sidebars stay out.
<script src="…/context.js" data-key="YOUR-KEY" async></script>
<div data-affilinode="context" data-limit="3"></div>
<!-- or without a placeholder: box automatically after the 3rd paragraph -->
<script src="…/context.js" data-key="YOUR-KEY" data-context-after="3" async></script>
- Without a placeholder and without data-context-after, the script reads and sends nothing.
- Only the page text and the page address (without parameters) are sent – no visitor data, no cookies. affilinode doesn't store the text; the result per page is cached for ten minutes.
- context.js is the same script as embed.js – both addresses work, one is enough per page.
- The display is included in the Publisher plan; for other paid plans you book it as the add-on "Contextual Ads" under "Billing" (cancelable monthly). Without it, the box stays empty on your pages; the generator then shows a note, and the live preview (with a sample article about headphones or your own sample text) works anyway.
Content via API
Better than the text from the browser: your website delivers its posts directly to affilinode. Each post is then analyzed once per version, and the script only asks with the page's address. Set it up under Websites → your website → "Content": affilinode fetches WordPress (public REST API), Discourse (new and active topics) and Ghost (Content API with the Content API key) hourly; Discourse and Ghost additionally report changes immediately by webhook. With the WordPress plugin it works without fetching: Settings → "Matching the article" → "Send posts … to affilinode", then once "Send all posts now".
- Only plain text (without HTML, at most 12,000 characters), title and address are stored – no visitor data. Deleted, withdrawn or protected posts are hidden.
- Your own integration: POST /v1/content with the website's API key, up to 50 posts per call. For server-side display there is GET /v1/content/context?url=… (in the WordPress plugin [affilinode_context]).
- In the "Content" tab you see how many posts affilinode knows, when it was last fetched and whether a fetch failed.
WordPress multisite: central or per subsite
If your website has subsites (WordPress multisite, see tracking IDs → subsites), you choose at the top of the "Content" tab how the content is managed: "Whole website centrally" shows one overview for everything. "Per subsite" shows each subsite individually – with count, state of the AI analysis, the latest posts, own sources, a switch "Contextual Ads for this subsite" and a delete button of its own. Content without a subsite (for example from Discourse or Ghost) appears there under "Without subsite".
- Without a choice of your own, affilinode decides automatically: "Per subsite" as soon as subsites are detected and the plugin sends posts with a blog ID – otherwise central.
- If a subsite is switched off, affilinode no longer accepts its posts, and "Matching the content" works there as without stored content. What is already stored stays until you delete it; deleted posts are still discarded immediately.
- The switches only apply in "Per subsite" mode. If you choose "Whole website centrally", all subsites are connected again.
- An own source per subsite exists for WordPress (the subsite's REST API). With the plugin you don't need it.
Contextual Ads+ (AI analysis)
With Contextual Ads+, a language model reads every delivered post: does someone want to buy something here? Which product type, which budget, which properties are mandatory ("must support Zigbee", "up to €300")? The box then shows exactly such products and, under each title, the reason, for example "Fits: Zigbee, under €300". The analysis runs once per version, never per page view.
- **Which model:** affilinode's own model or Gemini through Google Cloud Vertex AI with a data center in the EU – never other external providers. If Vertex AI fails, the own model takes over.
- **What is removed beforehand:** comment sections, email addresses, phone numbers and links to people (profiles, author pages); other links are shortened to the domain, the text to the beginning. Google doesn't use the content for training.
- **Included in the plan** is Contextual Ads+ in Publisher (or as an add-on). **Without** it, you switch it on per website through credits: Websites → your website → "Content" → "Allow AI analysis through credits" (off by default). Every analyzed version of a post then costs credits (starting price 2 credits); unchanged posts are not charged again, failed analyses cost nothing. If the balance isn't enough, the analysis pauses.
Without Contextual Ads+, the suggestions come from the terms in the post, without a reason. Balance and usage per website are under "Credits".
Shortcodes and product links in the text
For blogs and forums in whose posts you can't set HTML, the script understands further settings on the script tag. The "Ghost & forums" tab under "Generate code" produces the matching code; you then need no placeholders.
- data-shortcodes="1": Shortcodes such as [affilinode_product id="…"] in the text become boxes – with the same names and attributes as in the WordPress plugin.
- In the middle of a sentence: [affilinode_link id="…" text="…"] becomes a text link, [affilinode_field id="…" field="price"] a single value (price, title, link, button, shop, availability, stars, rating, reviews, brand, list_price, percentage_saved, last_update, thumb, asin). Both stay in their place in the text and look like the links and text of your page; instead of id, asin="…" also works. More attributes: shop="amazon|ebay|awin", price="1" (price in the link text), hide_unavailable="1". As in the boxes, links are labeled as ads (rel="sponsored", note on hover, prices with *).
- data-links="box" or "compact": Amazon, eBay and Awin links as well as links to offers from your catalog become boxes or rows, at most data-links-max per post (default 3). Links in quotes and code stay unchanged.
- data-links-scope: CSS selector of the post content, in case the script doesn't find it itself.
- Only the link addresses are sent for this, no visitor data.
Clicks to your analytics
With data-analytics="ga4,gtm,umami,matomo" on the script tag, the script reports clicks on shop links to the named services – only to those your page already loads (gtag, dataLayer, umami, _paq/_mtm). Without the attribute, nothing is reported. data-analytics-event sets the event name for GA4, Tag Manager and Umami (default affiliate_click).
- Sent along are shop, product (affilinode ID), product_name (shortened), box_kind (display), position (in best-of lists) and link_domain (the domain only, never the affiliate URL). Embedding doesn't send prices.
- The data goes to your analytics service, not to affilinode. Your consent tool handles consent: if it only loads the tracker after consent, the script reports nothing beforehand.
Rejected domains
If a domain that isn't approved requests the boxes, they stay empty there. Such domains appear on the key under "Rejected domains (30 days)" and additionally as a task. If it is your own domain, you click "Approve". If it is a foreign domain, your code was copied – then, when in doubt, revoke the key and create a new one.
Under "Clicks per display (30 days)" you see how often which display was visible and clicked. Every request counts toward your plan's API quota.