Drupal 7 had the Tracking Code module that did the following:
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()
We're thinking of porting this module. But, I am wondering if there is a better way to accomplish the same thing that does not require porting another module?
Recent comments
UPDATE: I fixed the errors that I found in the logs. They were related to deleting an old blog content type pulled over from Drupal that was still referenced in one of the layouts. I updated...
missing "add block" in custom layout
Hmmm... this sounds like a bug with Copy Blocks. Would this possibly be related: https://github.com/backdrop-contrib/copy_blocks/issues/26 https://github.com/backdrop-contrib/...
missing "add block" in custom layout
Also this error: Warning: Undefined array key "blog" in summary() (line 63 of /app/core/modules/layout/plugins/access/entity_bundle_layout_access.inc). I did recently delete an old blog...
missing "add block" in custom layout
I don't see any errors in the browser console, but there's this error in the logs Warning: Trying to access array offset on null in summary() (line 63 of /app/core/modules/layout/plugins/...
missing "add block" in custom layout
What's missing there is the dropbutton, which is rendered by Javascript. Have you checked the browser's console for Javascript errors? Also check the site log just in case.
missing "add block" in custom layout