Announcement

Collapse
No announcement yet.

Understanding what the GA4 Configuration does

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

  • Nick
    replied
    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.

    Leave a comment:


  • lesliekirk
    started a topic Understanding what the GA4 Configuration does

    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
Working...
X