Site logo

Archived topic

Google Adwords Tracking Code - Form In Sidebar

3 replies · Started by Craig on June 3, 2021

Viewing posts 1–4 of 4

Hi - sorry to bother, I could not find the answer: in with type of Element --> Hook do you place the Event click tracking snippet from Google. Is it in the generate_before_right_sidebar_content?

Does that make sense? Have a form sitting in a side bar and need to measure the submit clicks.

THX GP!!!

Hi Craig,

I'm not sure I fully understand your question.

What does the instruction from Google say?

What kind of snippet is it? Could you explain a bit more? Thanks!

Let me know :)

Hi Ying -

It is the Event Click for Google to track form submissions. Snippet looks like below, I already had it installed in the header, but not sure it will pick up the form submits in the sidebar form?

<!-- Event snippet for TDV Lead Form Submit 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-010010101/39K-CMnOmX4bEB',
'event_callback': callback
});
return false;
}
</script>

Not sure if it works for this specific one, but mostly we insert these kind of script into wp_head hook.

You can have a try :)

This archived topic is closed to new replies.