Jump to content

Send Google conversion tracking when rules are checked


Michal Mroz

Recommended Posts

Posted

Hello,

I'm trying to set up a Google conversion tracking in my store. I can easily add it to the payment button with onClick attribute and it works almost great.

<button type='submit' class='ipsButton ipsButton_important ipsButton_veryLarge ipsButton_fullWidth' onClick="ga('send', 'event', 'przycisk', 'zamow', {'nonInteraction': true});"><i class='fa fa-check-circle'></i> {{if $amountToPay->amount->compare( $invoice->total->amount ) !== 0}}{lang="confirm_and_pay_split" sprintf="$amountToPay"}{{else}}{lang="confirm_and_pay"}{{endif}}</button>

However, it counts all clicks - even those when rules are not accepted. I'd like to set up a condtional, so GA code would only fire if Rules were checked. How can I make it?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...