Skip to content

Google Analytics code is not conform the new gtag.js method. #12941

Closed
@kanduvisla

Description

@kanduvisla

The current way on how Google Analytics is implemented is by using the i,s,o,g,r,a,m / analytics.js-method. But the new implementation of Google Analytics now wants you to use the gtag.js-way of including GA:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-79159807-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXXXX-X');
</script>

Preconditions

Checked in latest develop branch of Magento 2.2

Steps to reproduce

Enable GA.

Expected result

Embed GA using gtag.js

Actual result

It's embedded using analytics.js-way (well, there is a UI component now for it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is validGate 1 Passed. Automatic verification of issue format passed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions