Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we Use php script in Google Tag Manager [closed]

Just wondering if a php code could be executed via Google Tag manager?

Thanks

like image 784
Gill Avatar asked Dec 04 '25 18:12

Gill


1 Answers

No. The Google Tag Manager inserts client-side Javascript. PHP requires a server that is configured for PHP. Inserting a PHP script via GTM would just output the raw PHP code to the browser, it would not execute the code.

If you want to include the results of a PHP Script you would have to run the script on your own server and fetch the results via Javascript as suggested in UncleRicos answer.

like image 90
Eike Pierstorff Avatar answered Dec 06 '25 08:12

Eike Pierstorff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!