Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
Pull the Report Title into the JavaScript used in a Custom Control Page Module

I am working on adding the Google Analytics code, to my Cognos reports, to help track usage from our website. I have created a page module custom control that does work correctly when the report page loads. The code currently sets the report name manually in the code. I want to have the control dynamically get the report name. The code for the page module is:

define( ["https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"], function() {

function PageModule()
{};
 
PageModule.prototype.load = function( oPage )
{
 window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXXX', {
  'page_title' : 'Cognos Report Name'
});
};

I know Cognos has a function that will get the report name when added in a query item. I am trying to get the same report name pulled into the custom control without having to add a unique query item in the report. Is it possible to get the report name using JavaScript, and if so, what code do I need to insert in place of Cognos Report Name? Any suggestions would be greatly appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I received a reply from dougp to my posting, on cognoise, that resolved my problem. Here is the final code which is based on Google Analytics 4.

define( ["https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"], function() {

function PageModule()
{};
 
PageModule.prototype.load = function( oPage )
{

window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-XXXXXXXXXX',
  { 'page_title': (new DOMParser()).parseFromString(oPage.application.Document.reportXML, "text/xml").getElementsByTagName("reportName")[0].childNodes[0].nodeValue }
  );
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda