Funnelish™ Community

How to add google ad conversion code on thankyou page?

There is no order amount and transaction id on the thankyou page, what should I do?

1 Like

@Jimmy.Xu you can do something like this:

<!-- Event snippet for Purchase ( conversion page -->
  gtag('event', 'conversion', {
      'send_to': '{your tracking id here}',
      'value': funnelish.getCookie("funnelish_order_value"),
      'currency': 'USD',
      'transaction_id': new Date().getTime()+''

The Funnelish Facebook Pixel app stores the previous order value into a cookie named "funnelish_order_value" which you can read on the next step after an order, which means you’ll need to add that code to any individual step that comes after a checkout or upsell (not just a TYP).

For the transaction id, I simply used getTime(), which would return current UNIX time, which is random.

Didn’t find funnelish_order_value related cookie, but according to your suggestion, I found fnsh-ga-order_details from storage, it should work, thanks.

1 Like

funnelish_order_value is used by the Facebook Pixel app, and it’s available only during page load… so it disappears immediately once the FB pixel app finished loading… that’s done on purpose so that even if customers refresh the page it will not double fire the pixel.

fnsh-ga-order_details is similar and it’s used by Google Analytics app, it includes more details.

Thanks for the clarification. Through fnsh-ga-order_details, I added a last_transaction_id. After the user pays or refreshes the page, if the transaction_id in fnsh-ga-order_details is the same as the last_transaction_id, no more data will be sent