how to add google adsense code only for specific users?

This topic contains 8 replies, has 3 voices, and was last updated by  findedeineband 4 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #542204

    findedeineband
    Free User
    Post count: 23

    Hi all,

    could someone tell me how i add the google adsense code at one of the marked locations in the picture.

    important is that the code only apears by specific member of my geodirectory.
    I have Basis, Premium and Deluxe as Members. The Adds should only apear at the Basis Entrys.

    thx 4 helping.

    #542254

    Kor
    Moderator
    Post count: 16516

    Hi findedeineband,

    Thanks for your post. You’ll have to customize the template for this theme https://wpgeodirectory.com/docs-v2/templates/details/#customize to achieve this. Since it’s a bit complex, this falls outside of what we’re able to offer for support.

    #542272

    findedeineband
    Free User
    Post count: 23

    hi Kor,

    is it no possible to add the code in the GD-Badge like this:

    [gd_post_badge key=”package_id” condition=”is_equal” search=”2″ badge=”<script async src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <!– xxxx –>
    <ins class=”adsbygoogle”
    style=”display:block”
    data-ad-client=”xxxxxxx”
    data-ad-slot=”xxxxx”
    data-ad-format=”auto”
    data-full-width-responsive=”true”></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    </script>”]

    #542328

    Alex Rollin
    Moderator
    Post count: 27815

    Try using GD Dynamic Content in an HTML widget
    https://wpgeodirectory.com/docs-v2/design/gd_dynamic_content/

    With Dynamic Content you can allow it to show with only a specific price package like only basic if the package id=4

    From your screenshot it looks like you will want to add that to the GD Details template

    https://wpgeodirectory.com/docs-v2/templates/details/

    #542377

    findedeineband
    Free User
    Post count: 23

    Hey Alex,

    thx for your input. I’ve already thought of something similar. Look i added this in the GD Dynamic short code editor. But unfortunately nothing shows up in the front end. Maybe because Adsense first have to check my site.

    If i add Text instead of the Script it works perfect.

    Do i have to ad someting to that short code that it recognizes its html ?
    Because if i add for testing amazon ref links it also dont apear in the front end.

    only if i write pure text appears. Like “this is a test if it works” hope you understand what i mean.

    thx for your support
    Alex

    #542413

    Alex Rollin
    Moderator
    Post count: 27815
    #542502

    findedeineband
    Free User
    Post count: 23

    Hey Alex,

    thx for reply. i do not want to edit the functions.php of my site.
    So is it not possible to get the adsense code working on GD Details Page in the center not in the Sidebar with the Dynamic Content Shortcodes?

    #542538

    Alex Rollin
    Moderator
    Post count: 27815

    Shortcodes should render if you add them directly to the WP Details page. Not working?

    #542667

    findedeineband
    Free User
    Post count: 23

    hey Alex, i think i found a solution which works!
    it the test is succesful i will post here my solution! 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket