How to display adsense ad Units Only for Mobile users.

Discussion in 'Programming' started by nazhaRu, Nov 8, 2018.

Tags:
  1. nazhaRu

    nazhaRu Registered Member

    Joined:
    Jul 8, 2017
    Messages:
    50
    Likes Received:
    2
    Gender:
    Female
    Hi ALL,

    Google Adsense allows publishers to edit Responsive ad units, so publishers can display or hide ads on specific devices. Unfortunately, I don't know how to that. Would you mind to provide me with a legit code that respects the system TOS? and Can I depend on ad inserter "devices" option to do that?

    Thanks.
     
  2. Gogol

    Gogol Jr. VIP Jr. VIP

    Joined:
    Sep 10, 2010
    Messages:
    4,353
    Likes Received:
    3,855
    Gender:
    Male
    Occupation:
    Dreaming
    Location:
    Pale Blue Dot
    Home Page:
    You could do it with a few lines of php code e.g.

    Code:
    https://stackoverflow.com/a/4117597/1437261
    
    Instead of the redirection (in the example I gave you), paste your embed code.
     
    • Thanks Thanks x 1
  3. Black catty

    Black catty Junior Member

    Joined:
    Nov 3, 2018
    Messages:
    106
    Likes Received:
    19
    Gender:
    Female
    Occupation:
    student
    Location:
    corona
    Via php you able to do by using agent headers and this is not against TOs some time we need to display some portions on mobile or some time just on desktop so its ok no problem with this approach
     
  4. nazhaRu

    nazhaRu Registered Member

    Joined:
    Jul 8, 2017
    Messages:
    50
    Likes Received:
    2
    Gender:
    Female
    Thanks!
     
  5. nazhaRu

    nazhaRu Registered Member

    Joined:
    Jul 8, 2017
    Messages:
    50
    Likes Received:
    2
    Gender:
    Female
    cloud you please clarify your answer ,?