Google Analytics (GA) Allows us to tracking everything into our pages. we could add new events using Drupal JavaScript Behaviors.
Drupal has a module called Google Analytics, this module has already implemented GA common features, then this article will give you a brief step by step to implement a custom GA event using a Drupal javascript behavior.
Drupal give us an excellent documentation about how to setup our settings file, but what about if we are developing our site using a local environment, what shall we know? which are the best practice that we must keep in mind.
On web security we need to be two steps ahead, then if we expose any resource or path we should not trust that any request is coming from our page. Drupal implements token validation to achieve that, on this page we walk through on a simple example about how do that.
Basically we should use two functions that Drupal provides us,
Copyright © 2019. All rights reserved.