Skip to main
← Index

Install Walityk on WordPress

Step-by-step guide to install the Walityk tag on WordPress / WooCommerce and ship first events to GA4 and Meta.

This guide covers installing Walityk on a WordPress site (or WooCommerce store). Installation is a snippet pasted into the <head> — no dedicated plugin to install. Plan for 5 minutes.

1. Create your site in the dashboard

  1. Sign in to the Walityk dashboard.
  2. Sites → New site: enter your domain and pick the WooCommerce platform (or Custom (HTML/JS) for a WordPress without a store).
  3. Click Create site. The Installation tab shows your ~10-line snippet with your site ID already filled in.

2. Paste the snippet in <head>

Two options:

  1. Install an insertion plugin like WPCode (formerly Insert Headers and Footers): Plugins → Add New.
  2. Open Code Snippets → Header & Footer (or equivalent).
  3. Paste the Walityk snippet into the Header box, save.

Directly in the theme

In a child theme, add to functions.php:

add_action('wp_head', function () { ?>
<script>
(function(s,i,e){
  s.__tftq=s.__tftq||[];
  s.__tftq.push(['init',{site_id:i,endpoint:e+'/collect'}]);
  var t=document.createElement('script');
  t.async=true;
  t.src=e+'/tag.js';
  document.head.appendChild(t);
})(window,'YOUR_SITE_ID','https://tag.walityk.com');
</script>
<?php });

The snippet is non-blocking (async): no impact on site speed. If you run a cache/optimization plugin (WP Rocket, LiteSpeed…), exclude tag.walityk.com from JS defer/delay so collection isn’t postponed.

3. WooCommerce: enable ecommerce auto-detection

On your site’s page in the dashboard, enable Ecommerce auto-detection. The tag then infers events from structured data (JSON-LD / Open Graph) and standard WooCommerce buttons:

  • view_item on product pages
  • add_to_cart on add-to-cart button clicks
  • begin_checkout on checkout entry
  • purchase on the order confirmation page

It’s a heuristic: after enabling, check in live events that all 4 events come through on your theme. The tag also automatically emits page_view, scroll milestones, outbound clicks and form_submit.

4. Connect your destinations

On the Destinations page of the Walityk dashboard:

  • GA4: paste your Measurement ID (G-XXXXXXX) and Measurement Protocol API secret.
  • Meta CAPI: Pixel ID + Conversions API token.
  • Google Ads: connect your account, pick the conversion actions to receive.

5. Verify events are flowing

  1. In the dashboard, open your site’s page → View live events.
  2. In another tab, browse your site: homepage, product page, add to cart.
  3. Events appear in real time.
  4. Check Meta Events Manager → Test events (≤ 30s) and GA4 → Realtime (instant).

Not working?

  • No events at all: open DevTools → Network, look for a request to tag.walityk.com. If missing, check the snippet is in the <head> (View page source) and that no cache plugin stripped or deferred it.
  • /collect request blocked by CORS: the site’s domain doesn’t match the domain declared in the dashboard — fix it.
  • Missing add_to_cart / purchase: auto-detection is a heuristic; heavily customized themes may not be recognized. Push the event manually: __tftq.push(['track', 'purchase', { value: 49.00, currency: 'EUR', transaction_id: 'ORD-1234' }]) on the confirmation page.
  • Meta duplicates: disable your client-side Pixel (often installed via another GTM/PixelYourSite plugin). Walityk ships via CAPI; the pixel duplicates.

What’s next?

  • By default the tag runs in cookieless mode (no cookies, no banner required). If you use Cookiebot, Axeptio or Didomi, switch the site to banner mode (Consent Mode v2, CMP auto-detected).
  • Enable Google Ads conversions for your paid campaigns.
  • Add your custom events (newsletter, lead form) via the tracking plan.

Need help? Write to hi@walityk.com — we answer within 1 business day.