Google Tag Manager

Google Tag Manager is a free tool that manages marketing tags in marketing applications. Once configured in Sitecore Content Hub™, various information from Content Hub can be shared with other applications (for example, Analytics) through Google Tag Manager.


To start using Google Tag Manager with Content Hub, you need to add the container ID of your Google Tag Manager to the key field in Google Tag Manager configuration in Settings.


To get the container id, log into your Google Tag Manager account and find the container id located on the top right side of the user interface.


Content Hub automatically sends information about specific events and actions to Google Tag Manager.

NameEvent dataTriggering action
  • id: the entity Id
  • definition: the definition name
  • lifecycle: the new lifecycle status
Change the status of an entity (approve or reject).
  • id: the entity Id
  • definition: the definition name
Delete an entity.
  • conversion: the rendition name
  • id: the entity Id
  • Definition: the definition name
Download an asset (one of the available renditions).
  • id: the entity Id
  • definition: the definition name
Create draft action on an entity.
  • section: the container name
  • id: the entity Id
  • definition: the definition name
Save changes after editing an entity/portal page.
  • facet: the label of the facet
  • definition: the taxonomy definition
Add a facet filter.
  • searchterm: the full-text search value
Perform a full-text search.
  • target: the target count
  • individualconversions: the number of individual conversions
The download order request is successful (status code: 201).
  • info: the size of the paging
Set the page size in the paging menu.
  • info: first
Go to first page.
  • info: previous
Go to previous page.
  • info: next
Go to next page.
  • info: last
Go to last page.
  • culture: the culture of the page
  • page: the page object
Load a new page (any page).
  • info: the selected page index
Jump to a page.
  • id: the entity Id
  • definition: the definition name
Preview an asset.
  • id: the entity Id
  • definition: the definition name
Publish a theme or a portal version.
  • field: the selected field name
  • operator: the selected operator name
  • searchterm: the search term values
Perform a query builder search.
  • score: the score
  • id: the entity Id
  • definition: the definition name
Save the user score (after rating an entity).
  • query: the search query
  • count: the search results count
  • config: the search defaults
Perform a search.
  • facet: the facet field name
Get all facet values.
  • facet: the taxonomy label
  • definition: the taxonomy definition
Click on show more facets.
  • direction: descending or ascending
  • field: the selected field
Perform a data sorting.
  • file: the file name
Upload a new file.

All the events have an additional dynamic parameter named options that contains the page options and that is used for deriving the page name. For an example configuration file, see GTM-workspace-M-Events.json.


If you want to send information about custom actions/events to Google Tag Manager, you can use the Analytics.log() method built into Content Hub, or you can use window.dataLayer.push(). Whichever you use, the code should be added to the external component.

For example, using Analytics.log():

Analytics.log = function (eventName, eventData, options) { ... }

In this example:

  • eventName: the event name, written lowercase and without any spaces.
  • eventData: array of extra information or data you want to include for this event.
  • options: page options, which are optional and are used for deriving the page name.

Alternatively, you can use window.dataLayer.push(), as shown in this example:

    'event': 'eventName',
    'data1': 'eventData1',
    'data2': 'eventData2'

For more information about using window.dataLayer.push(), see The data layer on Google Developers.

Example: Lock event

The Lock event contains the id of the entity and the entity definition name. It also contains the page name the action is triggered from because this information is derived from the options.

Analytics.log("lock", { id: entity.systemProperties.id(), definition: entity.definition.name }, options);

Example: ChangeLifeCycle

The change life cycle event occurs upon approval or rejection. The event contains the entity's id, the definition name, and the lifecycle, for example, approve or reject and so on.

The page name is derived from the options parameter.

Analytics.log("changelifecycle", { id: sentity.systemProperties.id(), definition: sentity.definition.name, lifecycle: config.lifeCycle }, options);

Can we improve this article ? Provide feedback