# Google Analytics 4

# Measure activity across platforms with User-ID

The User-ID feature lets you associate your own identifiers with individual users, so you can connect their behavior across different sessions and on various devices and platforms. Analytics interprets each user ID as a separate user, which provides you with more accurate user counts and a more holistic story about a user's relationship with your business.

# Instruction

The integration of the platform is based on the implementation of the following scripts:

  1. Initialization code, which must be on each subpage of the store, e.g. in the head section of the HTML code. It could be also added via Google Tag Manager.
<script type="text/javascript">
    if('{user_id}') {
        window.dataLayer = window.dataLayer || [];
        gtag('config', 'G-XXXXXXXXX, { // G-XXXXXXXXX -> measurement ID
            'user_id': '{user_id}'
         });
        
        window._edrone = window._edrone || {};
        _edrone.user_id = '{user_id}';
    }

</script>

To locate measurement ID go to article (opens new window).