2

I'm making an enhanched ecommerce tracking with google analytics. I'm following the existing implementation in gtag.js. I have 4 checkout steps including shipping method data, payment method data, pending payment, and also paid (purchase). I've made the codes for each step below:

1. Shipping Method

<script>
    gtag('event', 'set_checkout_option', {
        "checkout_step": 1,
        "checkout_option": "shipping method",
        "value": ""
    });
</script>

2. Payment Method

<script>
    gtag('event', 'set_checkout_option', {
        "checkout_step": 2,
        "checkout_option": "payment method",
        "value": ""
    });
</script>

3. Pending Payment

$("#order-now-action").on('click', function() {
    gtag('event', 'set_checkout_option', {
        "checkout_step": 3,
        "checkout_option": "pending",
        "id": ""
    });
})

This is the checkout funnel that I created in Ecommerce Settings. enter image description here enter image description here And this is a report in the checkout behavior menu. The shipping method is recorded, but why in step 2 (payment method) to step 4 (purchase) is it not recorded? enter image description here enter image description here even though, in the sales performance menu, the transaction is recorded? enter image description here enter image description here for steps 1-3 is in 1 page, while the purchase (step 4) I did on the backend using a single url. Is it because it's on 1 page so it's not recorded?

3
  • Since you already asked this over at Stack Overflow here, it's really best to flag it there for migration to another site, or delete it there after posting on another site like this one. Cross-posting questions to different Stack Exchange sites are really not condoned since that spreads answers out among them.
    – dan
    Nov 10 at 7:25
  • Sorry, cause I'm new in this webmaster forum @dan
    – frankfurt
    Nov 10 at 7:41
  • 1
    No worries, welcome to the site btw. I'd recommend deleting it on Stack Overflow since it's not specifically about programming and is a better fit for this site. Perhaps someone will come along and give you some help here - good luck!
    – dan
    Nov 10 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.