Drupal Advent Calendar day 17 - Analytics

By lostcarpark_admin, 1 December, 2024
Door 17 reveals a rising bar graph on a projector screen

Today we are looking at the Analytics Track of Drupal Starshot.

The current Analytics recipe uses the Google Tag module to set up tags to be tracked by Google’s Tag Manager application, to provide comprehensive site analytics for marketers. It can also integrate with Google Analytics.

It also ties in with the privacy track, covered on day 10, using Klaro to verify user consent before tracking the user.

This recipe is still at a fairly early stage, and does not currently appear on the install screen or project browser. This is because it requires user input while being applied, to get the site’s tracking, which is not yet supported in the front end.

So at present, this recipe can only be applied from the command line. If developing a Drupal CMS site with DDEV, you can use the following command to apply a recipe:

ddev recipe-apply recipes/drupal_cms_analytics/

The Google Tags configuration lets you configure the analysis on your site:

Screenshot of Tag Manager settings

Note the cookie acceptance in the corner.

This track is being led by Dharizza Espinach. I expect the functionality will be expanded as the project progresses, with a major milestone the addition to Project Browser and the installer, when user input is supported in the browser. I’m also hopeful that other options beside Google Tags will be supported, including native Drupal options such as the Visitors Module.

Comments

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.