Custom plugin

Hi there, I want to add google analytics by using this method:

Is it possible?

Thanks.

Hello @logoglo,

Thanks for asking. :slight_smile:

I haven’t tried the solution you have shared. But, in case you want to add Google Analytics via the use of a plugin, have you tried installing Google Analytics plugin from X > Validation > Extensions. Please try it out and see how it goes. I am sharing tutorial link that you can take a look.

Please note that the wpmudev tutorial link you have shared involves custom scripts and codes. For integrations and any problem arising because of that falls outside the scope of support we can offer.

Thanks for understanding.

I didnt want a full blown plugin, I tried monster analytics, buts got un compressed java code etc, I wanted to create this lightweight plugin for myself…did you read the method? the reason I ask is because it does have wp_head in the header.php in the theme…

Hi there,

Yes the wp_head hook is exist in the header.php. You can use the hook for the plugins.

Thanks

Im not seeing it…

Hi again,

wp_head(); exists in /framework/views/header/base.php file (see screenshot) so you can use the wp_head action hook in your plugin.

Hope this helps!

Perfect, thanks, I will give it a go.

Sure, do let us know how it goes!

It worked a treat!

Glad to hear that. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.