E-commerce Tracking Orders Dates Mismatch Issue Google Analytics

The name of the picture


E-commerce Tracking Orders Dates Mismatch Issue Google Analytics



I am facing a big issue with google analytics, its not showing up orders with correct date. A user on website placed order on 20-July-2018 but its showing up under 22-July-2018. As I checked my code 2-3 times and its having proper conditions to submit the reports only once for a order but really don't know whats wrong with API implementations. Can anyone have idea about this ?



Javascript Code :-


<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-1179*****', 'auto');
ga('send', 'pageview');
</script>



PHP Code :-


/* applied check to call this only once for a order */
echo "<script> ga('require', 'ecommerce');";
echo "ga('ecommerce:addTransaction', {
'id': '{$trans['id']}',
'affiliation': '{$trans['affiliation']}',
'revenue': '{$trans['revenue']}',
'shipping': '{$trans['shipping']}',
'tax': '{$trans['tax']}'
});";

//echo $this->getTransactionJs($trans);
foreach ($items as &$item) {
echo "ga('ecommerce:addItem', {
'id': '{$trans['id']}',
'name': '{$item['name']}',
'sku': '{$item['sku']}',
'category': '{$item['category']}',
'price': '{$item['price']}',
'quantity': '{$item['quantity']}'
});";
}
echo "ga('ecommerce:send');</script>";





When you check the pageviews, that are generated on this same success page, do they show up on the correct date, or do you see similar differences? It might give you an idea, whether this is ecommerce specific, or general to your Analytics implementation.
– kgrg
5 hours ago





date format timezone is same on website and google analytics. I already checked that.
– Kuldeep Singh
5 hours ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Stripe::AuthenticationError No API key provided. Set your API key using “Stripe.api_key = ”

CRM reporting Extension - SSRS instance is blank

Keycloak server returning user_not_found error when user is already imported with LDAP