Archived topic
Best Practice to Add Google Event Snippet (Page Load)
1 reply · Started by Kar Yung on February 11, 2022
Is the best/easy method still to just install some sort of headers/footer plugin that will add the following type of code into the head or is there a GP way of doing it? I have multiple pages that I wish to track with the same code.
<!-- Event snippet conversion page -->
<script>
gtag('event', 'conversion', {'send_to': 'AW-XXX/XXX'});
</script>
Hi there,
A hook element would be what you are looking for:
https://docs.generatepress.com/article/hooks-element-overview/
https://docs.generatepress.com/article/wp-head/
https://docs.generatepress.com/article/wp_footer/