Track custom page title and page url

Hi,

I’m trying to log a custom title and custom page url using the tag manager. And I thought something like this should work:

_mtm.push({‘customTitle’: ‘Custom page title’});
or
_mtm.push({‘mtm.customTitle’: ‘Custom page title’});

But this doesn’t work. What am I doing wrong?

N.B. I’m looking at this code: Support custom title and url for pageviews by tsteur · Pull Request #123 · matomo-org/tag-manager · GitHub by @thomas_matomo

@remcolmaybe you are wanting to use _paq.push(['setCustomTitle', '']) ? That might help. Otherwise you basically need to set up a variable in tag manager that reads that data layer value and assign this variable to the Custom Title field in the Matomo Configuration Variable. Depending how your knowledge is re tag manager the paq.push method may be easier.

Thanks for your fast reply!

I’m a bit confused about using _pag.push since the MTM uses _mtm.push.
Are you suggesting to switch to the JavaScript Tracking Client? Or am I missing something here? (JavaScript Tracking Client: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3)

I do get your suggestion about setting up a variable in the tag manager that reads that data layer value and assign this to the Custom Title field in the Matomo. I will give that a try.

@remcol I was suggesting _paq as a workaround / possible solution as the Matomo Tag Manager includes the Matomo Tracking code and you could basically bypass the tag manager using _paq and change the custom title directly this way. I haven’t tested it, but I would assume this works.