Add Datrika to WordPress

No theme edits needed: add the script with the WPCode plugin.

Replace YOUR_SITE_ID with your site ID in Datrika. Copy the script with the ID filled in from your site settings, on the General tab.

Add it with WPCode

WPCode is a free plugin that adds the script to the header of every page. You don't touch your theme, and the script survives theme updates.

  1. In your WordPress admin, open Plugins → Add New Plugin, search for WPCode, then install and activate it.
  2. Open Code Snippets → Header & Footer.
  3. Paste the script into the Header field and click Save Changes.
<script defer
  src="https://cdn.datrika.app/da.js"
  data-datrika
  data-site-id="YOUR_SITE_ID">
</script>

Using a cache plugin such as WP Rocket or LiteSpeed Cache? Clear the cache after saving, or the script won't show up on your pages right away.

Done? Open your site in a browser - the setup guide in Datrika picks up the first visit and takes you to your dashboard.