Decide when each piece of vendor code runs
A trigger action is the moment TermsFeed Privacy Consent inserts a vendor tag: on accept, on decline, on load permanent, or on load transient. Every vendor tag type (JavaScript, HTML, Style, and Link) offers all 4. The custom vendor form shows them as the switches "If allowed", "If declined", "On load (permanent)", and "On load (transient)". On accept and on decline follow the answer from the visitor, and the 2 on-load trigger actions ignore it.
Use this table to compare them before you fill a slot.
| Trigger action | Inserted | Follows the answer | Removed |
|---|---|---|---|
| On accept | Once the vendor is allowed, on load and after each answer | Yes | Never in that page view |
| On decline | Once a saved answer declines the vendor | Yes | From the vendor <div>, if the visitor accepts later in that page view |
| On load permanent | Every page view, before any on-accept or on-decline vendor tag | No | Never |
| On load transient | Every page view, before any on-accept or on-decline vendor tag | No | Once a saved answer exists, for any vendor |
A vendor tag goes in at most once per page view, so answering again does not run it a second time. Look up where each vendor tag type inserts its code in Vendor Tag Matrix.
On accept: the code runs after consent
An on-accept vendor tag runs when the vendor is allowed, on page load and right after an answer, with no page reload. A vendor is allowed when its vendor category or the vendor itself is on. The visitor turns it on with I Agree or Save Selection on the consent banner, or Save Preferences in the Preferences Center. I Agree and Accept this vendor in an embed placeholder do the same.
Essential vendors run their on-accept vendor tags on every page view with no answer. Under the opt-out model, where no consent banner shows, every other vendor runs them too until the visitor opts out. Find out which visits follow that model in Cookie Banner by Visitor Location.
A visitor who withdraws consent does not stop a vendor that already ran in that page view. Its on-accept content stays until the next page load, which applies the decline in full.
Paste JavaScript into an on-accept slot inside a <script> element. Privacy Consent reads every slot as HTML, so code without one lands as text at the end of <body> and never runs.
On decline: the code replaces a refused service
An on-decline vendor tag runs only after a saved answer declines the vendor, on that page view and on later ones while the answer stands. It never runs before a first answer, so a visitor who ignores the consent banner does not get on-decline code. It does not run for a vendor added after the answer until the visitor answers again, because that visitor was never asked about it.
Use on decline for content that stands in for the service, such as a contact link in place of a chat widget. A vendor that ran earlier in the page view gets its on-decline tags at the next page load, so on decline does not run at the moment of a withdrawal. A visitor who accepts later in the page view gets the on-accept content at once, and the on-decline content leaves the vendor <div>. On-decline code in <head> stays until the next page load.
On load permanent: the code runs whatever the answer
An on-load permanent vendor tag runs on every page view for every visitor, with or without consent, and stays on the page. Use it only for code that does not contact a vendor host or set a cookie, such as CSS that reserves space for an embed. Reserve that space with Prevent Layout Shift.
Every on-accept and on-decline vendor tag waits for all on-load vendor tags, with no time limit. An on-load <script src> without async whose server never answers holds those tags for every vendor until the browser gives up on it. Add async to any external script you put in an on-load slot.
On load transient: the code leaves once an answer exists
An on-load transient vendor tag runs on every page view, and Privacy Consent removes it from the page once a saved answer exists. A first-time visitor keeps it until the first answer. Any saved answer counts, from the consent banner, the Preferences Center, or an embed placeholder, even one that accepts or declines another vendor. A returning visitor gets it inserted and removed in the same page view, so the content appears briefly.
Privacy Consent removes every node the vendor tag inserted, once its iframes, images, and stylesheet links have loaded or failed. An eager iframe or image that never finishes keeps its vendor tag on the page, and a script that ran is not undone.
Why a tracking script never goes in an on-load slot
A tracking script in either on-load slot runs before the visitor answers and for visitors who decline, which is the tracking the consent banner exists to prevent. The on-load transient slot is no exception, because the script has sent its requests and set its cookies by the time Privacy Consent removes the element.
Put every script that sets cookies or sends visitor data in an on-accept slot, then test a live site for this mistake in a new private window. Open Chrome DevTools, select the Network tab, filter for the vendor host, and click I Decline. A request to the host points to an on-load slot or a snippet left in the page. Trace it with the steps for a script that fires after a refusal.
The Google Analytics 4, Google Ads, and Google Tag Manager templates put the Google tag in the on-load permanent slot on purpose. Privacy Consent sends the Google Consent Mode v2 defaults before that slot runs, and the tag does not set a cookie before consent. Read about that setup in Set Up Google Consent Mode v2.
Which trigger action to use for your code
Use on accept for almost everything, and add the other 3 only for fallback content and layout. Most custom vendors need one vendor tag, JavaScript on accept. Match your goal to a trigger action.
| Goal | Trigger action | Example |
|---|---|---|
| Load a tracking, advertising, or marketing script after consent | On accept | A chat or analytics snippet |
| Load an embed after consent | On accept | An iframe in an HTML vendor tag |
| Show an alternative to visitors who decline | On decline | A contact link in place of a chat widget |
| Reserve space whatever the answer | On load permanent | CSS with a min-height for a video slot |
| Show a message only until the visitor answers | On load transient | A note that the map loads after consent |
| React once, at the moment the visitor answers | None: use a callback | A call that stops your feature on withdrawal |
A trigger action follows the consent state on each page view, so none of them fires once at the click. Run code at the moment of an answer with Run Code on Accept or Decline.
Confirm which vendor tags ran on a page. Open Chrome DevTools, select the Elements tab, and search for termsfeed-pc1-vendor-tag-id=, the attribute on every element Privacy Consent inserts from a vendor tag. On-load transient elements carry data-termsfeed-pc1-vendor-transient= beside it while they stay on the page.