I wanna create plugin wich will place google analytics code or any other js code in footer.
Can I do it like this?
<?php
/*
Plugin Name: myplugin
Plugin URI:
*/
function myganalytics() {
?>
<script>
// my google analytics script
</script>
<?php
}
add_action('wp_footer', 'myganalytics');
?>