Tips on Customizing Independent Analytics – Google Analytics Alternative for WordPress

How to Hide Independent Analytics Admin Menus

function plt_hide_independent_analytics_menus() {
	//Hide "Analytics".
	remove_menu_page('independent-analytics');
	//Hide "Analytics → Analytics".
	remove_submenu_page('independent-analytics', 'independent-analytics');
	//Hide "Analytics → Settings".
	remove_submenu_page('independent-analytics', 'independent-analytics-settings');
	//Hide "Analytics → Help  Support".
	remove_submenu_page('independent-analytics', 'independent-analytics-support-center');
	//Hide "Analytics → Changelog".
	remove_submenu_page('independent-analytics', 'independent-analytics-updates');
	//Hide "Analytics → Upgrade to Pro".
	remove_submenu_page('independent-analytics', 'https://independentwp.com/pricing/?utm_source=User+Dashboard&utm_medium=WP+Admin&utm_campaign=Upgrade+to+Pro&utm_content=Sidebar');
}

add_action('admin_menu', 'plt_hide_independent_analytics_menus', 1000000000);

Where do I put this code?

How to Hide the "Analytics Open Dashboard" Dashboard Widget

function plt_hide_independent_analytics_dashboard_widgets() {
	$screen = get_current_screen();
	if ( !$screen ) {
		return;
	}

	//Remove the "Analytics                                    Open Dashboard" widget.
	remove_meta_box('iawp', 'dashboard', 'normal');
}

add_action('wp_dashboard_setup', 'plt_hide_independent_analytics_dashboard_widgets', 20);