Expand my Community achievements bar.

SOLVED

Google Ads Conversion Pixels not working

Avatar

Level 3

Dear All, 

We would like to implement Google Conversion Pixels on our website:
Google Ads, that we prepared here, but it is not working . Could you please help

priyankagupta20_0-1684989914366.png

It should fire, when someone clicks on the Submit button (successfully sent form)
Before implementing Usercentrics it worked, with the rule above, but currently it does not work anymore.


<!-- Event snippet for Surgery Contact 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-273165026/ljXNCJnZ3-cBEKKmkGKP',
      'event_callback': callback
  });
  return false;
}
</script> 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @priyankagupta20 ,

It seems there is something in the website that is blocking our code which you don't have control of(that code used to block third-party scripts). To confirm the same, you have to disable this for now.

Please paste the same code under the Action “Adobe Analytics – Set Variables à Custom code”,
it would works.
If not possible then I would recommend below 2 steps.
   1. For page load rules, try changing the event for the rule to page top or page bottom.
   2. For submit or clicks, try using the Adobe Analytics extension's Set Variables and add the desired custom code there.

View solution in original post

4 Replies

Avatar

Community Advisor

I don't think you need some of that code....

 

The callback portion of this is really for when trying to call the conversion directly within the code from the button click.. but you have the Adobe trigger for that...

 

try just using this in your custom code:

gtag('event', 'conversion', {
   'send_to': 'AW-273165026/ljXNCJnZ3-cBEKKmkGKP'
});

 

This is all I use, and it's working fine for me.

Avatar

Community Advisor

Would you be willing to share a link to your site and where the pixels should be triggered so that we can see if there are any errors that would help us see the problem? Even sharing a link in Private Message if you don't want the link available publicly.

Avatar

Correct answer by
Community Advisor

Hi @priyankagupta20 ,

It seems there is something in the website that is blocking our code which you don't have control of(that code used to block third-party scripts). To confirm the same, you have to disable this for now.

Please paste the same code under the Action “Adobe Analytics – Set Variables à Custom code”,
it would works.
If not possible then I would recommend below 2 steps.
   1. For page load rules, try changing the event for the rule to page top or page bottom.
   2. For submit or clicks, try using the Adobe Analytics extension's Set Variables and add the desired custom code there.