Hosting with 20% off when you buy through the link

Tracking and consent

Paste GTM, GA4 and pixels in the admin's Scripts screen, hold them until the visitor accepts, and measure every lead with a conversion event ready for your tag manager.

Tracking codes (Google Tag Manager, GA4, the Meta Pixel, Hotjar) don't go in the theme. They're pasted into the Scripts screen of the admin, where the client or the traffic manager handles them without the AI. Velk adds two things: it can hold a script until the visitor accepts it, and it fires a conversion event on every lead.

Adding a script

  1. Open Scripts

    It's in the admin menu, with one row per code: its status and, once the theme has a banner, its consent.

  2. Create the script

    Name it (GTM, Meta Pixel) and paste the code exactly as the tool provides it.

  3. Choose the position

    The page's head (head), the start of the body (body_start) or its end (body_end). GTM is two codes: the main one in the head, the noscript at the start of the body.

  4. Order and switch

    Drag rows to reorder: within a position, GTM goes before anything that sends data to it. An inactive script never reaches the browser.

Analytics and ad pixels aren't needed for the site to work, and laws such as LGPD and GDPR ask for the visitor's permission. Consent is off by default for each script: one without a category always loads, right for a domain verification tag or an error monitor. Ticking “This script requires consent” lets you pick one of the categories the theme declares in site.json:

ModeBehaviour
Required (required)Always loads; the visitor can't turn it off.
Opt-out (opt_out)Loads until the visitor refuses. Often used for analytics, where the law allows it.
Opt-in (opt_in)Loads only after the visitor accepts. The one for marketing and remarketing; when in doubt, opt-in.

Good to know

  • Without declared categories, the screen offers “active by default” or “inactive by default”, and the banner can only accept or refuse everything.
  • Accepting turns held scripts on at once, without a reload. Refusing later applies from the next page: a script that already ran has set its cookies.
  • Codes of one service share a category, like the two GTM codes.
  • A script whose category left site.json stops loading and shows in red.

Ask the AI

The dental clinic site will use GA4 and the Meta Pixel. Set up consent with two categories: Analytics, loading until the visitor refuses, and Marketing, only after acceptance. Build the banner in the site's style at the bottom of the screen, with Accept all, Reject and Preferences, and a footer link to reopen it.

The AI declares the categories and writes the banner. Then paste the two codes in Scripts and pick each one's category.

Every lead is a conversion

Every completed form submission sends an event called velk_form_success to the page's dataLayer, the queue Google Tag Manager reads, with the form's id, the lead's number and the visit's campaign. Nothing to turn on: in GTM, fire your lead tags (GA4's generate_lead, Google Ads, Meta) from a trigger on that event, telling forms apart by form_id. The name is fixed, so one container serves every Velk site. A completed member registration sends velk_signup_success.

Without a tag manager, paste a code to run on each conversion on the form's screen; the library itself (gtag, fbq) stays in Scripts. On a form sent without reloading the page, ask the AI to make the theme run that code.

When the event fires

SituationFires?
A submission is completedYes, once.
An intermediate step of a multi-step formNo, only the last step.
A bot caught by the honeypot, a validation error, an expired sessionNo.
The e-mail or the webhook failedYes: a lead is a lead.
The page is reloaded afterwardsNo.

Enhanced conversions

On each form's screen, the Conversion tracking block asks which field is the e-mail and which the phone; nothing is mapped by default. Once mapped, both travel in the event in plain text, and the Google tag hashes them in the visitor's browser before sending, so Google Ads can match the lead when cookies fail. For member registrations, sending the e-mail is a separate option in Scripts, off by default.

Forms that end on a thank-you page (since v3.7.8)

A form sent without reloading the page that then moves to a thank-you page used to lose its conversion in the switch. Ask the AI to send it with _event=queue: Velk holds the event for up to 10 minutes and fires it once on the next page. It works for any form sent this way, multi-step forms and member registration included.

Ask the AI

After the quote form is sent, take the visitor to a thank-you page with our WhatsApp button, and make sure the conversion still reaches GTM. Then write a short note for our traffic manager: the trigger, the form_id of each form and the mapped fields.

The AI sends the form with _event=queue, checks the event on the thank-you page and writes the note from the event's fixed format.