Solution:
Your google snippet should be placed between your <head></head>
tag. In your child theme or active theme edit your header.php file where you should find the <head>
tag. I pref to add any snippet before wp_head()
function. Here is an example of header.php
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Event snippet for Solicitar cotação conversion page
In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-ID/AWID',
'event_callback': callback
});
return false;
}
</script>
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>