XF 2.2 AdWords Conversion tracking with stripe payments

cdub

Well-known member
I'm trying to figure out how to modify the code in the payment_initiate_stripe template to allow onclick conversion tracking for Google AdWords. Basically I want to track if an ad for my site results in a sale (user upgrade).

Here's the code I think I need to modify in the payment_initiate_stripe template:

<xf:form action="{{ link('purchase/process', null, {'request_key': $purchaseRequest.request_key}) }}" class="block block--paymentInitiate" data-no-auto-focus="on" data-xf-init="stripe-payment-form" data-publishable-key="{$publishableKey}" data-recurring="{{ $purchase.recurring ? 'true' : 'false' }}" data-pi-secret="{$paymentIntent.client_secret}" data-pr-enabled="{$paymentProfile.options.payment_request_api_enable}" data-pr-country="{$paymentProfile.options.stripe_country}" data-pr-cost="{$cost}" data-pr-currency="{$purchase.currency}" data-pr-label="{$purchase.title}">

Here's the instructions of the code to enter on Google's help page:

<button onclick="return gtag_report_conversion('http://example.com/your-link')">Submit</button>


Not sure where to add the onclick code. Anyone know where to add it?
 
Back
Top Bottom