First, Locate the header.php of your theme in the source code (wp-content > themes > your theme). Next, copy and paste the following code after the opening head HTML tag ()
<!-- dataLayer -->
<script>
var dataLayer = window.dataLayer = window.dataLayer || [];
<?php if(is_single()){ ?>
<?php $post = get_post(); ?>
<?php $author_id = $post->post_author; ?>
<?php $author_fullname = get_the_author_meta( 'display_name', $author_id); ?>
dataLayer.push({
'post_author_fullname': '<?php echo $author_fullname ?>',
'event': 'PostInformation'
});
<?php } ?>
</script>
<!-- End dataLayer -->
<!-- Google Tag Manager -->
<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','<YOUR-GTM-ID-HERE>');</script>
<!-- End Google Tag Manager -->
The code above initiates the dataLayer first and populates the information you need (in this case, the author on a blog post page). Next, Google Tag Manager is launched. The order is important, so do not change it. Note that you need to use your own GTM ID.
Second, you need to configure GTM to work with the information. Go to https://tagmanager.google.com and open your workspace.
On the left side, you'll see the main menu; click on the menu item Variables and click on the New button in the User-Defined Variables section.
Give the variable a name, choose the type Data Layer Variable, Name, and hit save to complete this step

Third, create another User-Defined variable to hold your Google Analytics tracking ID.

Fourth, create a new User-Defined variable to hold the Google Analytics Settings.

Make sure, the index corresponds with the index given in Google Analytics.

In Google Tag Manager, configure the tag as follows.

As you can see the info is being sent to GA:
