# Links Added After Page Load

> How AutoTag handles affiliate links that appear after the page loads, how to test them, and what to do when the Click ID is missing.

[AutoTag](/docs/autotag) works on the links that are in your page. A link the visitor cannot see yet is still in the page — but a link that does not exist yet is not.

That distinction decides whether your offer button carries the Click ID. It matters most on VSL pages, where the buy button appears partway through the video, and on any page where a script builds the link.

## Hidden Is Not the Same as Added Later

| Your link is… | Example | Tagged? |
|---------------|---------|---------|
| In the page, hidden with CSS | Offer button with `display: none`, revealed at 12:00 in the video | Yes — AutoTag treats it like any other link |
| In the page, below the fold or inside a collapsed section | Link in an accordion, FAQ, or tab the visitor has not opened | Yes |
| Added to the page by a script, after load | Button the video player inserts when the video ends | Verify — depends on how the script inserts it |
| Built by a JavaScript framework after data loads | Product list rendered by React or Vue once the API responds | Verify — see [Single Page Tracking](/docs/single-page-tracking) |
| Inside a modal that a script builds on click | "Get the offer" popup constructed when the visitor clicks | Verify |
| Rendered inside the video player's own iframe | CTA button drawn by an embedded player such as VTurb or converteai | **Never** — see below |
| Not a link at all | A `button` element that redirects with JavaScript | No — AutoTag needs a standard `a` element |

The first two cases need nothing from you. Revealing a hidden link changes nothing about its `href` — AutoTag already wrote the Click ID into it.

The middle cases are worth checking rather than assuming. Video platforms and page builders each insert elements differently, and the result varies.

The iframe case is different from all of them, and it is the one to rule out first.

## Check the Iframe First

Some embedded video players draw the CTA button **inside their own iframe** rather than in your page. AutoTag runs in your page's document and cannot reach inside an iframe, so a button rendered there is never tagged — no matter how long you wait or how the reveal is timed. The button could be there from the first millisecond and still receive nothing.

This matters because it looks identical to a timing problem, but nothing about timing, the Tracking Tag, or your integration settings will fix it.

**How to tell in one step:** put a plain HTML link to the same destination somewhere else on the page, outside the player, and load the page. If that link gets a Click ID and the player's button does not, the button is inside the iframe. Stop checking your postback URL, your link format, and your checkout platform — none of them are involved.

### Fix: put the Click ID on the page URL

Most embedded players build their button URL from the query parameters on the page that hosts them. Put the Click ID there and the player carries it through.

Use the [`atclidToUrl`](/docs/append-click-id-to-url) command, with the parameter name your destination expects — `cid` for a Digistore24 checkout, for example, rather than the default `_atid`:

```javascript
<script>
AnyTrack(function() {
    AnyTrack('atclidToUrl', 'cid');
});
</script>
```

<Callout icon="⚠️" theme="warning">
**This has to go on the page hosting the player**

The player reads the URL of the page it is embedded in. Adding `atclidToUrl` to an earlier page in the funnel does nothing — the value has to be on the URL of the page carrying the video.
</Callout>

<Callout icon="📘" theme="info">
**AutoScan showing nothing is not the same as tracking failing**

[AutoScan](/docs/autoscan) reads your page's initial source, so it cannot see links that only exist once a script has run. A page reporting **No elements found** may still track perfectly, because the Tracking Tag runs live in the visitor's browser. Assign the integration manually in AutoScan, then verify on the live page — the live page is the answer that counts.
</Callout>

## Check Your Link in 30 Seconds

<Steps>

  <Step title="Load the page the way a visitor would">
    Open your landing page in a normal browser window. If you have been editing the page, use an incognito or guest window so you are not looking at a cached version.
  </Step>

  <Step title="Let the link appear">
    Play the video, open the popup, scroll — whatever the visitor does to make the offer button show up.
  </Step>

  <Step title="Copy the link address">
    Right-click the button and choose **Copy link address**. Paste it into a text editor.
  </Step>

  <Step title="Look for the Click ID">
    The URL should contain your network's SubID parameter with a real value — `tid` or `vtid` for ClickBank, `subId1` for Impact, `sid` for CJ, `atclid` for your own domains. The parameter list for every network is in [Tracking Group ID](/docs/tgid).

    A URL with no parameter, an empty parameter, or a literal `--CLICK-ID--` still in it means the link was not tagged.
  </Step>

</Steps>

<Callout icon="📘" theme="info">
**Testing a long VSL without watching the whole video**

Duplicate the page, keep the same button, and swap in a video that is a few seconds long. The button reveals almost immediately and behaves identically for tracking purposes. Waiting out a 20-minute reveal to test one link is not a good use of your afternoon.
</Callout>

## Fixes, Best First

### Option 1 — Put the link in the page and hide it with CSS

Instead of having a script create the button when the video ends, put the button in the page from the start and reveal it.

```html
<!-- In the page from the start, hidden until the reveal -->
<a id="offer-cta" href="https://offer.com/product" style="display: none">
  Get Instant Access
</a>
```

Your script then only changes the visibility, never the link itself:

```javascript
document.getElementById('offer-cta').style.display = 'block';
```

This is the most reliable option because it removes the timing question entirely. AutoTag tags the link at page load, and the reveal is purely cosmetic. Most video players and page builders support this — look for a "show existing element" option rather than "insert HTML".

### Option 2 — Use the `--CLICK-ID--` token

If the link must be written by a script, include the token in the URL your script inserts. The Tracking Tag replaces it with the real Click ID:

```html
<a href="https://offer.com/product?sub1=--CLICK-ID--">Get Instant Access</a>
```

Replace `sub1` with your network's parameter. Verify the result with the copy-link test above — if the token is still literally in the URL after the link appears, the script inserted the link after the replacement had already run. Use option 3 instead.

### Option 3 — Build the URL with the Click ID yourself

When your script fully controls the link, read the Click ID directly and write it into the URL. Wrap the call in the AnyTrack callback so it runs only once the Tracking Tag has finished loading:

```javascript
AnyTrack(function() {
  var atclid = AnyTrack('atclid');
  var offerUrl = 'https://offer.com/product?sub1=' + atclid;

  // Use offerUrl when you create or reveal the button
  document.getElementById('offer-cta').href = offerUrl;
});
```

The callback matters. Calling `AnyTrack('atclid')` before the tag has loaded returns nothing, and you end up building a URL with an empty parameter — which looks tagged but attributes nothing.

<Callout icon="⚠️" theme="warning">
**A button is not a link**

If your CTA is a `button` element that navigates with JavaScript, none of these options apply until you give AutoTag something to work with. Either convert it to a standard `a` element, or build the destination URL with option 3 before redirecting.
</Callout>

## The Click ID Is There but Conversions Still Are Not Attributed

If the copied URL contains a valid Click ID, tagging is working and the problem is further down the chain. The usual cause is something between the click and the offer rebuilding the URL: a click tracker, a link shortener, or a redirect script that constructs the destination from a hardcoded value and drops everything AutoTag added.

The tell is that a page *without* that redirect attributes correctly while this one does not — which points at a script on this page, not at your account settings.

To confirm, open your browser's network tab, click the button, and follow the redirect chain hop by hop until the parameter disappears. Every redirect in the path has to pass the full query string through. The full sequence is documented in [Affiliate Click ID Journey](/docs/affiliate-click-id-journey).

***

<FaqAccordion
  title="FAQ & Troubleshooting"
  items={[
    {
      question: "My offer button only appears at the end of a 20-minute video. Will it be tagged?",
      answer: "Usually yes, but confirm rather than assume. If the button is in the page from the start and merely hidden until the video reaches a certain point, AutoTag treats it like any other link. If the button is inserted into the page only when the video ends, the result depends on how your video platform or custom script adds it. Let the button appear, right-click it, copy the link address, and look for the Click ID."
    },
    {
      question: "My VSL button is drawn by the video player itself. Why does it never get a Click ID?",
      answer: "Some embedded players, such as VTurb and converteai, render the CTA button inside their own iframe. AutoTag runs in your page's document and cannot cross into an iframe, so a button rendered there is never tagged — this is not a timing issue and waiting or re-checking the Tracking Tag will not change it. Confirm it by placing a plain HTML link to the same destination outside the player: if that link gets a Click ID and the player's button does not, it is the iframe. The fix is to put the Click ID on the page URL with <code>AnyTrack('atclidToUrl', 'your_parameter')</code> so the player carries it through — see <a href='/docs/append-click-id-to-url'>Append Click ID to URL</a>."
    },
    {
      question: "AutoScan says No elements found on my VSL page. Is my tracking broken?",
      answer: "Not necessarily. <a href='/docs/autoscan'>AutoScan</a> reads the initial page source and cannot see links that a script creates later. The Tracking Tag runs live in the visitor's browser and can tag links AutoScan never saw. Assign the integration manually in AutoScan, then verify on the live page with the copy-link test."
    },
    {
      question: "The link still shows --CLICK-ID-- after it appears. What happened?",
      answer: "The token is replaced by the Tracking Tag, so a link inserted into the page after that replacement has run keeps the literal placeholder. Build the URL yourself instead: read the Click ID with <code>AnyTrack('atclid')</code> inside the <code>AnyTrack(function() { ... })</code> callback and set the href from your own script."
    },
    {
      question: "Does this apply to links inside an accordion, a tab, or below the fold?",
      answer: "No. Those links are already in the page, just not visible. AutoTag tags them at page load and revealing them changes nothing."
    },
    {
      question: "My site is a single page app and links render after the data loads. What should I do?",
      answer: "Read <a href='/docs/single-page-tracking'>Single Page Tracking</a> first, since route changes in a single page app also affect PageView tracking. For the links themselves, verify with the copy-link test and fall back to building the URL with <code>AnyTrack('atclid')</code> if they are not tagged."
    },
    {
      question: "Can I test this without publishing changes to my live page?",
      answer: "Duplicate the page with the same button and script, and swap in a short video so the link reveals immediately. The duplicate behaves the same way for tracking purposes, and you avoid testing on the page that is taking live traffic."
    }
  ]}
/>

## Related

- [AutoTag](/docs/autotag)
- [Affiliate Click ID Journey](/docs/affiliate-click-id-journey)
- [Append Click ID to URL](/docs/append-click-id-to-url)
- [AutoScan](/docs/autoscan)
- [Link Tracking](/docs/link-tracking)
- [Single Page Tracking](/docs/single-page-tracking)
- [Click ID Usage](/docs/generate-retrieve-and-use-atclid)
