Archived topic
WPcode light
22 replies · Started by Michael on February 1, 2023
Hi Fernando, thanks. I'll try that later; at the moment, I prefer to try things one at a time,
David, please let me know the code for the header and footer. (and whether it's worth testing wp_body_open for the footer code),
Michael
Ok, lets start from the top:
1. delete any Elements you have created so far that are related to this topic.
2. Appearance > Elements --> Add New --> Hook.
2.1 Give it a Title for the GTag head code
2.2 In the Text Area add:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1072711480"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1072711480');
</script>
NOTE: This is the code from this link
2.3 Set the Hook to wp_head
2.4 Set the Display Rules to Entire site
2.5 Publish the Hook, and exit it.
3. Appearance > Elements --> Add New --> Hook.
3.1 Give it a Title for the GTag Footer code
3.2 In the Text Area add:
<script>
window.addEventListener('load', function() {
if (document.location.href.includes('/nlp-practitioner-training/licensed-nlp-practitioner/')) {
gtag('event', 'conversion', {'send_to': 'AW-1072711480/jq5MCKjWmooYELiOwf8D'});
}
if (document.location.href.includes('/nlp-practitioner-training/nlp-master-practitioner/')) {
gtag('event', 'conversion', {'send_to': 'AW-1072711480/qY0xCKvWmooYELiOwf8D'});
}
if (document.location.href.includes('/nlp-business-practitioner/')) {
gtag('event', 'conversion', {'send_to': 'AW-1072711480/1-sNCK7WmooYELiOwf8D'});
}
});
</script>
NOTE this code was taken from this link
3.3 Set the Hook to wp_footer
3.4 Set the Display Rules to Entire site
3.5 Publish the Hook, and exit it.
And that should be it. Once its done let us know and we can check the sites code.
Thanks, David,
I really appreciate this. Would you check the site's codes and let me know,
Michael
https://drive.google.com/file/d/1xDVnXDP5Q6AnJLo8nv6ZY-qZD5BMF9G1/view?usp=share_link
https://drive.google.com/file/d/1Kf265W2DzRRSp3lnckQeANY6AhYaAraz/view?usp=share_link
I can see the one in the head.
Do you have any caches on your site ? If so can you clear them ?
To David,
I had this message from Google:
I see that the codes are firing on the website and are firing as expected! I did verify from my end everything is working fine. The status in the ads account as well for all the three conversions changed to recording conversions. I shall go ahead and close the case now, if you need further assistance with the case please feel free to reach out to me!
I checked your site again, and I too can see all the codes in the correct place.
So it sounds like this is working correctly now ?
Thanks, that's great!
Glad to be of help!