mercredi 11 décembre 2019

Combine a JS to conditional

JS newbie here. I have a landing page with two options - once and regular (two buttons). we have to include a script to the page, but can't have both firing and rather need it to be conditional.

The scripts are like this:

    <!-- Regular Donation -->
<script type="text/javascript">
window.adalyserTracker("trackEvent", "lce3", {value: 0.00, a4:"Regular"}, true);
</script>

<!-- One-off Donation -->
<script type="text/javascript">
window.adalyserTracker("trackEvent", "lce3", {value: 0.00, a4:"Once"}, true);
</script>

Any ninjas out there who can help combine those quickly to one (e.g. if id on the button = once, use 'Once', if Id on the button = regular, use 'Regular')

Thanks in advance :)

Aucun commentaire:

Enregistrer un commentaire