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:
Here's the instructions of the code to enter on Google's help page:
Not sure where to add the onclick code. Anyone know where to add it?
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>
Track clicks on your website as conversions - Google Ads Help
You can use conversion tracking to track when someone clicks a button or link on your website. For example, you can track when someone clicks a “Buy now” button, or when someone clicks a phone number
support.google.com
Not sure where to add the onclick code. Anyone know where to add it?