- This topic has 5 replies, 3 voices, and was last updated 7 years, 2 months ago by Tom.
-
AuthorPosts
-
February 20, 2017 at 5:05 am #281304imke
Hello,
I need some help:
I don’t succeed in verifying the google-site and google adsense.
I’m using a plugin for facebook/youtube/google+ – this works.
But the identification for google doesn’t work.
Google asked me to put the following into the head/html:
<meta name=”google-site-verification” content=”…..number…..” />
and
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: “…code-number…..”,
enable_page_level_ads: true
});
</script>I wasn’t sure, so I had a look in the generatepress support.
In GP-Hooks I added:<meta name=”google-site-verification” content=”….number….. />
add_shortcode( ‘adsense’ , ‘my_adsense_shortcode’ );
function my_adsense_shortcode()
{
ob_start();
?>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– Ad code –>
<ins class=”adsbygoogle”
style=”display:block”
data-ad-client: “….code-number….”
data-ad-slot:”…number…”
data-ad-format=”auto”></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<?php
return ob_get_clean();
}I activated php and saved the Hooks.
Then I had a look in the html-background of the website and couldn’t find anything.
And I assume google doesn’t find anything either.
website: view-source:http://bairisch-diatonischer-jodelwahnsinn.de/What’s wrong?
Thank you for helping!
ImkeFebruary 20, 2017 at 6:17 am #281339LeoStaffCustomer SupportHi Imke,
I would recommend giving Tom’s method a shot: https://generatepress.com/forums/topic/page-header-content-cannot-save/#post-221222
Let me know if this helps.
February 20, 2017 at 10:24 am #281448TomLead DeveloperLead DeveloperThat adsense code needs to be added to your functions, not GP Hooks: https://docs.generatepress.com/article/adding-php/
February 20, 2017 at 2:10 pm #281593imkeHello,
thanks for helping.
This is very complicated. There is no way just to go into html?
The next problem is to insert the google tag manager, too.
Could I manage this via ftp?Imke
February 20, 2017 at 4:16 pm #281615LeoStaffCustomer SupportHave you tried the method Tom suggested? You should be able to simply copy and paste the code into Code Snippet (make sure it’s activated).
https://docs.generatepress.com/article/adding-php/#code-snippetsFebruary 20, 2017 at 7:54 pm #281668TomLead DeveloperLead DeveloperInserting the google manager tag can be done using GP Hooks in the wp_head hook.
-
AuthorPosts
- You must be logged in to reply to this topic.