Jump to content

Can I unhook a different module with my module?


Recommended Posts

I'm trying to build a module I call 'Hide Me' that will prevent my google analytics and google tag manager modules from sending visitor info when I'm the one browsing the site.

So far I've been able to install a module. It creates a database. When I put a flag in the url ie mysite.com/?hideme=y, I have code in hookDisplayTop that will capture my IP and add it to the database. When I visit the site, if I have debug mode on, it will lookup every visitor to see if their IP is in the database of flagged IPs..

I think if it finds my IP, I can maybe set a smarty variable since its hooked in the context of 'displayTop' but then I'm not sure how I'd use that variable to keep the Google Analytics and Google Tag Manager from doing their thing. I'd really like to somehow turn off GA and the GTM modules when an IP is flagged, but I have no idea how to do it.

I'd like the app to be self contained without having to change code in the GA/GTM modules as it would be nice to share it with the community once its done.

If that's not possible, what else could I do to keep GA/GTM modules from firing once I have a flagged IP?

 

Thanks for any help!

 

 

Edited by rkk
spelling (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...