@@ -106,6 +106,11 @@ def _log_level(self):
106106 None ,
107107 allow_none = True ,
108108 help = """
109+ ..deprecated::
110+
111+ No longer supported. If you want to use Google Analytics, use :attr:`extra_footer_scripts`
112+ to load JS from Google Analytics.
113+
109114 The Google Analytics code to use on the main page.
110115
111116 Note that we'll respect Do Not Track settings, despite the fact that GA does not.
@@ -117,6 +122,11 @@ def _log_level(self):
117122 google_analytics_domain = Unicode (
118123 "auto" ,
119124 help = """
125+ ..deprecated::
126+
127+ No longer supported. If you want to use Google Analytics, use :attr:`extra_footer_scripts`
128+ to load JS from Google Analytics.
129+
120130 The Google Analytics domain to use on the main page.
121131
122132 By default this is set to 'auto', which sets it up for current domain and all
@@ -125,6 +135,13 @@ def _log_level(self):
125135 config = True ,
126136 )
127137
138+ @observe ("google_analytics_domain" , "google_analytics_code" )
139+ def _google_analytics_deprecation (self , change ):
140+ if change .new :
141+ raise ValueError (
142+ f"Setting { change .owner .__class__ .__name__ } .{ change .name } is no longer supported. Use { change .owner .__class__ .__name__ } .extra_footer_scripts to load Google Analytics JS directly"
143+ )
144+
128145 about_message = Unicode (
129146 "" ,
130147 help = """
@@ -943,8 +960,6 @@ def initialize(self, *args, **kwargs):
943960 "registry" : registry ,
944961 "traitlets_config" : self .config ,
945962 "traitlets_parent" : self ,
946- "google_analytics_code" : self .google_analytics_code ,
947- "google_analytics_domain" : self .google_analytics_domain ,
948963 "about_message" : self .about_message ,
949964 "banner_message" : self .banner_message ,
950965 "extra_footer_scripts" : self .extra_footer_scripts ,
0 commit comments