How to set up Google Analytics through Google Tag Manager for Next-Js?

后端 未结 6 978
北恋
北恋 2021-02-13 16:24

formerly I was using react-ga npm module to insert google analytics in my next js app. and It was simply like this:

import ReactGA from \'react-ga\'

export cons         


        
6条回答
  •  梦如初夏
    2021-02-13 17:03

    There is no need for any special library and some answers here look uncomplete. Just add the script to and noscript to in _document.js

    import Head from 'next/document'  
    
    
      
    
                                     
                  
提交回复
热议问题