Marketing Tags module

Personalization Bundled: DX Core

Edition DX Core

License

MLA

Issues

Maven site

Latest

2.0.1

Available on SPA/Headless

Yes

Marketing tags

Marketing tags are snippets of code that you insert on Web pages. Tags typically collect analytics information such as how many visitors view the page and how long they stay. Tags can also integrate third-party content such as social media on your site or insert ad campaigns. You can use tags to learn more about visitors or provide content.

A tag is typically a piece of JavaScript code. When a page loads, the JavaScript code runs and collects usage information about the page and the visitor. The tag then reports this information to the service that provided the tag. The service stores and analyzes the information.

If the service provides an analytics dashboard, you can display it in the Marketing Tags app.

Tags function diagram

Since many of these tags require cookies to work, you can also link tags to cookies defined in the Cookies app. By linking tags to cookies, you can make sure the tags used on your website comply with data privacy rules.

Installing with Maven

Bundled modules are automatically installed for you.

If the module is unbundled, add the following to your bundle including your project’s <dependencyManagement> section and your webapp’s <dependencies> section. If the module is unbundled but the parent POM manages the version, add the following to your webapp’s <dependencies> section.

  • Latest version

  • Latest bundled version

2.0.1
<dependency>
  <groupId>info.magnolia.marketingtags</groupId>
  <artifactId>magnolia-marketing-tags</artifactId>
  <version>2.0.1</version>
</dependency>
1.4.4
<dependency>
  <groupId>info.magnolia.marketingtags</groupId>
  <artifactId>magnolia-marketing-tags</artifactId>
  <version>1.4.4</version>
</dependency>

In Magnolia 6.2, preconfigured Magnolia DX Core bundles contain version 1.4.4 of the Marketing Tags module. Version 1.4 is compatible with the 5 UI framework. If you wish to use module version 2.0 (or higher), you must first remove the 1.4.4 module.

Configuration

Apps

The Marketing Tags app allows editors to insert tags such as JavaScript code snippets for analytics engines into Web pages.

Inserting tags in the Community Edition

The Marketing Tags module is a DX Core module. If you work with the Community Edition you can include code snippets on your pages as resource files.

  1. Include the code snippet as a resource file in your project.

    /<magnolia.resources.dir>/<my-module>/webresources/js/gtag.js
    <!-- Google tag (gtag.js) -->
    <script async src=“https://www.googletagmanager.com/gtag/js?id=YOUR-MEASUREMENT-ID”></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag(‘js’, new Date());
      gtag(‘config’, ‘YOUR-MEASUREMENT-ID’);
    </script>
  1. Use the Freemarker include directive in your template script, as if you were referencing another script.

    home.ftl
    <head>
       [#include “/my-module/webresources/js/gtag.js"]
    </head>
Feedback

DX Core

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the DX Core docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules