GA4和Shopify收入差异

huangapple go评论92阅读模式
英文:

GA4 and Shopify Revenue Discrepancy

问题

终于在stackoverflow上了,之前一直遇到无法匹配GA4分析和Shopify收入的问题。首先,我已经使用GTM集成了Shopify和GA4。我创建了自定义事件并按照要求提取数据。我还安装了适用于Shopify的Google和YouTube应用,并与相同的GA4帐户集成,结果发现GA4中的收入是Shopify内置分析报告中的两倍,这让我认为是应用程序使收入翻倍了。因此,我断开了应用与当前GA4的连接,结果收入相对较低。

示例

2023年8月6日的收入

Shopify:4023 AED

GA4:7200 AED

2023年8月8日的收入(断开Google应用程序-Shopify后)

Shopify:4073 AED

GA4:483 AED

> GA4与Shopify的集成方式如下:

  1. 在theme.liquid的head部分实施GTM标签
<script>
  window.dataLayer = window.dataLayer || [];
</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
  1. 在theme.liquid的body部分实施GTM标签
  2. Shopify设置->附加脚本->以下代码块
<script>
  window.dataLayer = window.dataLayer || [];
</script>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>

<script>
  products = [];
  {% for line_item in checkout.line_items %}
    products.push({
      'currency'            : '{{ shop.currency }}',
      'item_id'               : {{ line_item.product_id | json }},
      'item_sku'            : {{ line_item.sku | json }},
      'item_variant_id'  : {{ line_item.variant_id | json }},
      'item_name'        : {{ line_item.title | json }},
      'item_brand'        : {{shop.name | json}},
      'item_category'  : {{ line_item.product.type | json }},
      'price'                 :  {{ line_item.price | amount_without_currency | remove: "," | json }}/100.0,
      'quantity'            : {{ line_item.quantity | json }}
    });
  {% endfor %}

  transaction_data = {
    'transaction_id' : {{ checkout.order_number | json }},
    'affiliation' : {{ shop.name | json }},
    'value' : {{ checkout.total_price | amount_without_currency | remove: "," | remove: "." | json }}/100.0,
    'tax' : {{ checkout.tax_price | amount_without_currency | remove: "," | remove: "." | json }}/100.0,
    'shipping' : {{ checkout.shipping_price | amount_without_currency | remove: "," | remove: "." | json }}/100.0,
    'subtotal' : {{ checkout.subtotal_price | amount_without_currency | remove: "," | remove: "." | json }}/100.0,
    'coupon': '{{checkout.discounts[0].code}}',
    'discount': {{checkout.discounts_amount | amount_without_currency | remove: "," | remove: "." | json }}/100.0,
    'currency': '{{ shop.currency }}',
    'payment_type': '{{checkout.transactions.gateway}}',
    'items': products
  };
  user_data = {
    'full_name' : {{ checkout.shipping_address.name | json }},
    'first_name' : {{ checkout.shipping_address.first_name | json }},
    'last_name' : {{ checkout.shipping_address.last_name | json }},
    'address1' : {{ checkout.shipping_address.address1 | json }},
    'address2' : {{ checkout.shipping_address.address2 | json }},
    'street' : {{ checkout.shipping_address.street | json }},
    'city' : {{ checkout.shipping_address.city | json }},
    'province' : {{ checkout.shipping_address.province | json }},
    'zip' : {{ checkout.shipping_address.zip | json }},
    'country' : {{ checkout.shipping_address.country | json }},
    'phone' : {{ checkout.shipping_address.phone | json }},
    'email' : {{ checkout.email | json }}
  };
</script>
{% if first_time_accessed %}
<script>
  dataLayer.push({
    'event' : 'purchase',
    'pageType' : 'nur_purchase',
    'ecommerce' : transaction_data,
    'user' : user_data
  }); 
</script>
{% endif %}
  1. GA应用已断开连接,如下图所示:

GA4和Shopify收入差异

可以提供更多信息,真正导致数据收入下降的原因是什么?

英文:

Finally on stackoverflow after having endless problems with matching GA4 analytics and Shopify revenue. First off -

I have integrated shopify and GA4 with GTM. I have created custom events and pulling the data as per. I also have installed Google & Youtube Application for Shopify and integrated with the exact GA4 account and it seemed the revenue is doubled up in GA4 compared to shopify in built analytic report which led me to think its the application which doubles up the revenue. So I disconnected the app from my current GA4 which turns comparatively low in revenue.

EXAMPLE

Revenue in numbers on 06 AUG 2023

Shopify: 4023 AED

GA4: 7200 AED

Revenue in numbers on 08 AUG 2023 (after disconnecting Google App - Shopify)

Shopify: 4073 AED

GA4: 483 AED

> How GA4 is integrated with shopify is

  1. Implementing GTM tag on head on theme.liquid

    &lt;script&gt;
    window.dataLayer = window.dataLayer || [];
    &lt;/script&gt;
    &lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({&#39;gtm.start&#39;:
    new Date().getTime(),event:&#39;gtm.js&#39;});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!=&#39;dataLayer&#39;?&#39;&amp;l=&#39;+l:&#39;&#39;;j.async=true;j.src=
    &#39;https://www.googletagmanager.com/gtm.js?id=&#39;+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,&#39;script&#39;,&#39;dataLayer&#39;,&#39;GTM-XXXXXXX&#39;);&lt;/script&gt;
    
  2. Implementing GTM tag on body on theme.liquid

  3. Shopify settings -> additional script -> below code block

    &lt;script&gt;
    window.dataLayer = window.dataLayer || [];
    &lt;/script&gt;
    &lt;script&gt;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({&#39;gtm.start&#39;:
    new Date().getTime(),event:&#39;gtm.js&#39;});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!=&#39;dataLayer&#39;?&#39;&amp;l=&#39;+l:&#39;&#39;;j.async=true;j.src=
    &#39;https://www.googletagmanager.com/gtm.js?id=&#39;+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,&#39;script&#39;,&#39;dataLayer&#39;,&#39;GTM-XXXXXXX&#39;);&lt;/script&gt;
    &lt;script&gt;
    products = [];
    {% for line_item in checkout.line_items %}
    products.push({
    &#39;currency&#39;            : &#39;{{ shop.currency }}&#39;,
    &#39;item_id&#39;               : {{ line_item.product_id | json }},
    &#39;item_sku&#39;            : {{ line_item.sku | json }},
    &#39;item_variant_id&#39;  : {{ line_item.variant_id | json }},
    &#39;item_name&#39;        : {{ line_item.title | json }},
    &#39;item_brand&#39;        : {{shop.name | json}},
    &#39;item_category&#39;  : {{ line_item.product.type | json }},
    &#39;price&#39;                 :  {{ line_item.price | amount_without_currency | remove: &quot;,&quot; | json }}/100.0,
    &#39;quantity&#39;            : {{ line_item.quantity | json }}
    });
    {% endfor %}
    transaction_data = {
    &#39;transaction_id&#39; : {{ checkout.order_number | json }},
    &#39;affiliation&#39; : {{ shop.name | json }},
    &#39;value&#39; : {{ checkout.total_price | amount_without_currency | remove: &quot;,&quot; | remove: &quot;.&quot; | json }}/100.0,
    &#39;tax&#39; : {{ checkout.tax_price | amount_without_currency | remove: &quot;,&quot; | remove: &quot;.&quot; | json }}/100.0,
    &#39;shipping&#39; : {{ checkout.shipping_price | amount_without_currency | remove: &quot;,&quot; | remove: &quot;.&quot; | json }}/100.0,
    &#39;subtotal&#39; : {{ checkout.subtotal_price | amount_without_currency | remove: &quot;,&quot; | remove: &quot;.&quot; | json }}/100.0,
    &#39;coupon&#39;: &#39;{{checkout.discounts[0].code}}&#39;,
    &#39;discount&#39;: {{checkout.discounts_amount | amount_without_currency | remove: &quot;,&quot; | remove: &quot;.&quot; | json }}/100.0,
    &#39;currency&#39;: &#39;{{ shop.currency }}&#39;,
    &#39;payment_type&#39;: &#39;{{checkout.transactions.gateway}}&#39;,
    &#39;items&#39;: products
    };
    user_data = {
    &#39;full_name&#39; : {{ checkout.shipping_address.name | json }},
    &#39;first_name&#39; : {{ checkout.shipping_address.first_name | json }},
    &#39;last_name&#39; : {{ checkout.shipping_address.last_name | json }},
    &#39;address1&#39; : {{ checkout.shipping_address.address1 | json }},
    &#39;address2&#39; : {{ checkout.shipping_address.address2 | json }},
    &#39;street&#39; : {{ checkout.shipping_address.street | json }},
    &#39;city&#39; : {{ checkout.shipping_address.city | json }},
    &#39;province&#39; : {{ checkout.shipping_address.province | json }},
    &#39;zip&#39; : {{ checkout.shipping_address.zip | json }},
    &#39;country&#39; : {{ checkout.shipping_address.country | json }},
    &#39;phone&#39; : {{ checkout.shipping_address.phone | json }},
    &#39;email&#39; : {{ checkout.email | json }}
    };
    &lt;/script&gt;
    {% if first_time_accessed %}
    &lt;script&gt;
    dataLayer.push({
    &#39;event&#39; : &#39;purchase&#39;,
    &#39;pageType&#39; : &#39;nur_purchase&#39;,
    &#39;ecommerce&#39; : transaction_data,
    &#39;user&#39; : user_data
    }); 
    &lt;/script&gt;
    {% endif %}
    
  4. GA app is disconnected as below picture

GA4和Shopify收入差异

More info can be provided, what can really cause the issue in lowering data revenue?

答案1

得分: 0

通过卸载 Shopify 的 Google 应用程序来解决问题-防止数字冲突,并且只需在 theme.liquid 的 head 部分和用于结账的电子商务跟踪的自定义脚本上保留 gtm 脚本-> 还有一些其他的脚本,这些脚本在上面已经包含了。当然,Shopify 在线商店和 GA4 之间会有一些数字上的差异,因为它不是100%准确的。

英文:

it is solved by uninstalling google app for shopify - prevents number conflicts and just keeping gtm script on head on theme.liquid and on custom script for ecommerce tracking on checkout -> additional scripts which was included above. of course there will be a few number is going to be different from shopify online store to ga4 since its not 100% accurate.

huangapple
  • 本文由 发表于 2023年8月8日 23:35:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/76861092.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定