Google Analytics Extension Missing area to input tracking code

Hello: as my title states there is nowhere in the extension to enter the tracking code per your knowledge base tutorial: https://theme.co/apex/forum/t/extension-google-analytics/84

The picture in the knowledge base article shows a box for “analytics code” to be entered. I am only getting a box to enter “tracking id” and" meta tags". Where do i enter the script/code?

Hello @rlmills3rd,

Thanks for asking. :slight_smile:

You only need to add the ID to link google analytics. In case you want to add the script code then please install and activate child theme. You can download child theme from following source:

https://theme.co/apex/child-themes

After that add following code in child theme function.php file:

function third_party_tracking_code() { ?>

      <script>
       
      // Google Analytics.
      </script>

    <?php }

    add_action( 'wp_head', 'third_party_tracking_code' );  



Replace // Google Analytics. with the tracking code.

You also have the option to use Header and Footer plugin to add tracking code. Here are the details:

Note: Please note thatHeader and Footer plugin is not a official Themeco advice. It’s just a personal input that I have shared with you to help you get started. 3rd party plugins may cause some issues and we won’t be able to provide support in that scenario.

Thanks.

Is there any particular reason to do one over the other? Or can I just add the ID in the extension and call it a day?

Hi There @rlmills3rd

If you want to add Google Tag Manager code, you will need to use a 3rd party plugin or follow the above mentioned method explained by @Prasant.

Otherwise you can simply add Google Analytics ID to Google Analytics extension.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.