Replaced by: 

for Drupal 8+ JS / CSS assets
For Drupal 7 this module may still be used.

for Drupal 8+ Custom Meta Tags
For Drupal 7 this module may still be used.

for Drupal 8+ Standard Meta Tags

A module that allows admins to create tracking code snippets and control their visibility, similar to the core Drupal block module. It can be used to inject arbitrary code into the <head>, and at the beginning and end of the <body> tag, the most common placement for tracking code.

This module allows you to name your various tracking code snippets and organize them by weight and region. Configuration of a single snippet provides visibility settings similar to the core Drupal block module: white/black list by Drupal path, content type, and user role.

Currently, there are three possible regions to inject your tracking code snippets:

  • Inside <HEAD> - Code is added using drupal_add_html_head()
  • After <BODY> - Code is added to $page['page_top'] using hook_page_alter()
  • Before </BODY> - Code is added to $page['content_bottom'] using hook_page_alter()

You can also use drag & drop functionality on the tracking code overview page to change the relative weights of your snippets to make sure they execute in the correct order within a given region.

Tracking Code module is compatible with the Token module, which can be used to dynamically inject system and node variables into your tracking code snippets.

Drupal 8+: This module was not ported to D8/D9 because it was superseded by Asset Injector

Supporting organizations: 
Sponsored the 7.x-1.6 release
proudly helped to improve this module for the Drupal community

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon827 sites report using this module
  • Created by ColonelForbinX on , updated
  • Arrow iconDrupal 10 is here!

    No further development. Drupal 7 only.

  • shieldStable releases for this project are covered by the security advisory policy.
    Look for the shield icon below.

Releases