35 $this->
widget = new \YAWK\widget();
58 public function init()
63 public function embed()
65 if (isset($this->gaTrackingID)
66 && (!empty($this->gaTrackingID)))
69 $this->gaTrackingID = strip_tags($this->gaTrackingID);
73 echo
'<!-- google analytics -->
74 <!-- Global site tag (gtag.js) - Google Analytics -->
75 <script async src="https://www.googletagmanager.com/gtag/js?id='.$this->gaTrackingID.
'"></script>
77 window.dataLayer = window.dataLayer || [];
78 function gtag(){dataLayer.push(arguments);}
79 gtag(\'js\', new Date());
80 gtag(\'config\', \''.$this->gaTrackingCode.
'\');
84 { // tracking code not set, empty or wrong data type
85 echo "Google Analytics could not be loaded - tracking code not set, empty or wrong data type.";
if(isset($_POST['save'])) $settings