Announcement

Collapse
No announcement yet.

Understanding what the GA4 Configuration does

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Understanding what the GA4 Configuration does

    I have a store that has the GA4 configuration completed per the documentation provided (EXCELLENT work on this doc). However, the SEO team seems to be having issues with store purchases saying
    The report does not provide the correct source/medium information.
    The Google Technical Expert has asked if the
    GA 4 ecommerce code on the back end as per this document https://developers.google.com/analyt...lient_type=gtm
    Color me confused, I thought that is what the GTM-import.json does (did).

    Question - does the GTM have issues with a site that requires the customer to be logged in?
    Last edited by lesliekirk; 08-30-23, 04:17 AM. Reason: Thought of a question
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    #2
    lesliekirk There is a bug reported with the GA4 DataLayer that will cause issues with reporting directly due weather the customer is logged into the store or not. Currently the GTM-DataLayer.js file will pass a value of 0 as the cust_id for all customers that are not logged into the store, which causes the cust_id of zero to be grouped together rather than having unique values.

    To see the issue you can log into the GA4 account and select Explore and choose Blank. Once once the blank template is created change the Technique field to be User Explorer. If there are a ton of events for the user with 0 then that is likely the issue.

    To fix the issue you can manually update the GTM-DataLayer.js resource.

    Change this:

    Code:
    basket: {
        basketId: '&mvtj:global:Basket:basket_id;',
        custId: '&mvtj:global:Basket:cust_id;'
    },
    to this:

    Code:
    basket: {
        <mvt:if expr="g.Basket:cust_id GT 0">
            custId: '&mvtj:global:Basket:cust_id;',
        </mvt:if>
        basketId: '&mvtj:global:Basket:basket_id;'
    },
    This will only pass the customer ID if they are logged into the store.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      Nick the Google Technical Expert is saying that these items are not being reported

      item id, item name
      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #4
        It sounds like there may be issues with the GA4 setup for the store. The item id and name are definitely tracked with the default integration, here is the link to where they are tracked in the GTM-dataLayer.js file:

        https://github.com/mivaecommerce/sha...Layer.mvt#L445

        If you submit a ticket to me we can work on getting me access and I can take a look to confirm it is all set up correctly.
        Nicholas Adkins
        Technical Training Specialist / Miva, Inc.
        [email protected]
        https://www.miva.com/mivalearn

        Comment


          #5
          Originally posted by Nick View Post
          It sounds like there may be issues with the GA4 setup for the store. The item id and name are definitely tracked with the default integration, here is the link to where they are tracked in the GTM-dataLayer.js file:

          https://github.com/mivaecommerce/sha...Layer.mvt#L445

          If you submit a ticket to me we can work on getting me access and I can take a look to confirm it is all set up correctly.
          Hi Nick - my apologizes, I just saw your reply. I will submit a ticket with the understanding it is a holiday weekend. Thanks!
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment


            #6
            We've been using GA4 for several months. The Ecommerce Revenue has been underreported in GA versus our actual online revenue and that reported in Ad Words. I think we've corrected that problem after carefully following the Miva documentation for GA4.

            However, Item Revenue reflects the base price for the item rather than the actual unit price of base price less product discount. This obviously affects reporting and ROAS.

            I'm assuming this should be adjusted in the GTM-datalayer file. Currently price is assigned <mvt:assign name="l.ecommerce_item:price" value="l.settings:group:unit_base_price_comprehens ive" /> . I'm thinking this should be changed to <mvt:assign name="l.ecommerce_item:price" value="l.settings:group:unit_comprehensive" />.

            Does this sound right or will I be messing something up?

            Comment


              #7
              Darryl Gross Looking at the Google Analytics 4 documentation it looks as though they are expecting the base price for the items listed in the purchase event: https://developers.google.com/analyt...#purchase_item

              If you take a look at their example the price minus the discount equals the value.
              Nicholas Adkins
              Technical Training Specialist / Miva, Inc.
              [email protected]
              https://www.miva.com/mivalearn

              Comment


                #8
                Yes, that's true and it is what is being passed. However, that doesn't help my reporting. I created an Exploration in GA4 for Ecommerce Item and Variations per the Miva GA4 documentation (very helpful BTW). My item revenue shows the base price for items purchased. However, the item discount amount is the product of discount for the item purchased times the item quantity. The item quantity is many times more than the items purchased. In the regular Ecommerce purchases reporting under Monetization, the item revenue is the base price x items purchased. I went to see the actual item revenue (how much the customer is actually paying) which is base price less discount. We use product discounts extensively in our store. Seems like I should be passing the net price through the GTM-data layer script.

                Comment


                  #9
                  Originally posted by Darryl Gross View Post
                  Yes, that's true and it is what is being passed. However, that doesn't help my reporting. I created an Exploration in GA4 for Ecommerce Item and Variations per the Miva GA4 documentation (very helpful BTW). My item revenue shows the base price for items purchased. However, the item discount amount is the product of discount for the item purchased times the item quantity. The item quantity is many times more than the items purchased. In the regular Ecommerce purchases reporting under Monetization, the item revenue is the base price x items purchased. I went to see the actual item revenue (how much the customer is actually paying) which is base price less discount. We use product discounts extensively in our store. Seems like I should be passing the net price through the GTM-data layer script.
                  I'm still hanging around for this one because this almost sounds like what the Google Expert is telling the store owner who is also having an under-reporting issue.
                  Leslie Kirk
                  Miva Certified Developer
                  Miva Merchant Specialist since 1997
                  Previously of Webs Your Way
                  (aka Leslie Nord leslienord)

                  Email me: [email protected]
                  www.lesliekirk.com

                  Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                  Comment


                    #10
                    I went ahead and made the following change to the GTM-data layer file and entered a test order. Checking GA4 the next day, the item revenue is reporting correctly (actual $ paid). It didn't mess anything else up since total revenue is still reporting correctly = product revenue + shipping + sales tax. I'll keep an eye on this over the next week or so to confirm all reporting is correct and will post if something doesn't appear right.

                    Line 724 original: <mvt:assign name="l.ecommerce_item:price" value="l.settings:group:unit_base_price_comprehens ive" />

                    Changed to: <mvt:assign name="l.ecommerce_item:price" value="l.settings:group:unit_comprehensive" />

                    Comment


                      #11
                      It looks like Google's documentation is providing some contradictory information...

                      https://developers.google.com/analyt...e=gtm#purchase shows that the ecommerce.value should be (item.price - item.discount) * item.quantity for each of the ecommerce.items. This is documentation the integration was built to follow.

                      However, another, newly discovered article https://developers.google.com/analyt...lient_type=gtm shows that the ecommerce.value should be item.price * item.quantity for each of the ecommerce.items.

                      I will reach out to Google for some clarification, but it looks like the second "Apply a discount to an ecommerce event" example may be the correct way due to: 1.) the fact that the page's purpose is to depict how to send discounts and 2.) the under-reporting issues people are experiencing. If that is the case, then using l.settings:group:unit_comprehensive would be the correct variable to change it to.

                      Comment


                        #12
                        Google's support on this primarily points to https://developers.google.com/analyt...lient_type=gtm being the correct way to go here. Therefore, the item.price should be set to the :unit_comprehensive variable instead of the :unit_base_price_comprehensive value and we'll work on providing a bugfix for this.

                        However, I believe this would not create an "under-reporting" issue, it would create an "over-reporting" issue; right? For example $1,000 product with a 10% discount would currently have it's ecommerce.items[].price set to 1000. Then, GA would be showing Item Revenue at $1,000 which is $100 over what it should be: $900

                        lesliekirk and Darryl Gross, are there any other value issues that you're seeing beyond the Item Revenue metric discussed above? I just wanted to clarify this to understand what people mean by under-reporting and I want to ensure we resolve any other issues that people might be experiencing.

                        Comment


                          #13
                          Regarding underreporting in GA4. For us, I believe our underreporting issue was due to the purchase amount not being reported in GA4 when a purchaser was not signed in, e.g., they checked out as a guest. We added the change (suggested in an earlier post on this thread by Nick)

                          Change code from:
                          basket: {
                          basketId: '&mvtj:global:Basket:basket_id;',
                          custId: '&mvtj:global:Basket:cust_id;'
                          },

                          Change to:
                          basket: {
                          <mvt:if expr="g.Basket:cust_id GT 0">
                          custId: '&mvtj:global:Basket:cust_id;',
                          </mvt:if>
                          basketId: '&mvtj:global:Basket:basket_id;'
                          },

                          This seems to give us correct reporting.

                          Comment


                            #14

                            Originally posted by SteveoSoule View Post
                            lesliekirk and Darryl Gross, are there any other value issues that you're seeing beyond the Item Revenue metric discussed above? I just wanted to clarify this to understand what people mean by under-reporting and I want to ensure we resolve any other issues that people might be experiencing.
                            The Google Technical Solutions person points to
                            we could find it is just the "view item" code and not purchase code.
                            and I was given this request

                            Can you add the "purchase" code per this document https://developers.google.com/analyt...lient_type=gtm?
                            When I attempted to follow the instructions they attempted to blow the tag up - reporting numerous errors. I went back to the Google Techincal person and asked why was I being asked to do this with the Google Console, why couldn't they do it?

                            When I get a better clarification of what Google seems to think is missing I will come back and post it.
                            Leslie Kirk
                            Miva Certified Developer
                            Miva Merchant Specialist since 1997
                            Previously of Webs Your Way
                            (aka Leslie Nord leslienord)

                            Email me: [email protected]
                            www.lesliekirk.com

                            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                            Comment


                              #15

                              Originally posted by Darryl Gross View Post
                              Regarding underreporting in GA4. For us, I believe our underreporting issue was due to the purchase amount not being reported in GA4 when a purchaser was not signed in, e.g., they checked out as a guest. We added the change (suggested in an earlier post on this thread by Nick) ... This seems to give us correct reporting.
                              Ok thank you for clarifying. A newer version of the google-analytics integration will be released to https://github.com/mivaecommerce/google-analytics with this change as well.


                              Originally posted by lesliekirk View Post
                              When I get a better clarification of what Google seems to think is missing I will come back and post it.
                              Ok thank you. I am not aware of any other issues with the purchase or view_item events, but please let me know if you get any more specific details.

                              Comment

                              Working...
                              X