laraveladsense

How to add google AdSense to Php Laravel?


I can't add google AdSense to Laravel. Tried adding a package as well but didn't work? Please guide me.


Solution

  • First you need to creat adsense account. login and add new site. Provide the url and it will give you a script to put in side head tag like this.

    <script async 
      src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca- 
      pub-123456789123456"
         crossorigin="anonymous"></script>
    

    once you place the script then it will be verified. and you can create adds and templates to show ads. Hope this helps.