Hello,
I'm creating a Google Ads campaign and I'm using the Music State template. I need to implement USER_ID in the Google Analytics tracking code, through the Tag Manager.
To do this, among other things, I need to insert the following PHP code in the "head" section (before </head>)
// For USER_ID in Google Analytics tracking code
<? php
$ user = JFactory :: getUser ();
$ userId = $ user-> get ('id');
yes ($ user-> id! = 0) {
$ USER_ID = $ userId;
}
?>
I have searched for extensions but I can not find one that does this task.
How can I do this without losing the change when I update the template?
If it is not possible, what is the file to be intervened and how?