Social Gallery WordPress Plugin

Social Gallery Adsense Setup

Social Gallery Adsense Setup
You can now put Adsense Adverts in Social Gallery!

You read that right folks! You can now put Adsense ad’s alongside your fantastic blog images! As of Social Gallery v2 you can enable Adsense ads directly in Social Gallery, in place of the comments box. You probably don’t need me to tell you that’s 1) pretty cool and 2) hugely useful to content sellers – your images can now effectively 10X your ad space – without being offensive or over the top! Engage users while they are happily skipping through your blog images which already exist, waiting to bring in more ad revenue.


To set up Adsense with Social Gallery is really easy, but there is 1 caveat:

To use Adsense with Social Gallery you will need to have a Google DFP account. You should be able to easily get a DFP account if you already have an Adsense account. (DFP is Googles ad-serving platform, you don’t need to use all its features here – but you do need to have an account.) The reason you can’t directly put Adsense code into Social Gallery is that Social Gallery is AJAX heavy – it does all sorts of things on-the-fly. Adsense does not allow you to use it’s adverts on AJAX content unless through DFP. Hence why we need DFP to serve adverts with AJAX in Social Gallery.

You don’t need to know all the technical side to get it working, you can just follow the 9 simple steps below – but please read this disclaimer before proceeding:


Disclaimer: While the functionality provided in Social Gallery is designed to allow for advertisements to be displayed through DFP, I the developer and Social Gallery have no relation to Google what so ever. I cannot help, advise or be held responsible for anything you do which affects your account’s at Google (any of them) or your eligibility for accounts. All functionality is provided “as-is” and will not work unless you have a live DFP account and good standing with Google. If Google changes their terms and conditions I cannot be held responsible if this feature becomes defunct or causes issue.


Once you understand that – here’s a tutorial on how to set up Google Adsense and Social Gallery for WordPress:

1. Get Social Gallery – if you haven’t already got it you can buy Social Gallery here.

2. Got Social Gallery? Great. Now do you have an Adsense account? If you do skip ahead to 3.

To get an adsense account go here: and sign up. It’s an easy process and all good content providers wont have a problem getting an account.

3. Get a DFP Account.

Head on over to Google DFP and click “Get Started”. You’ll have to fill in a few of your details and importantly your Adsense account code. It’s a 5 minute job and in my experience they give you an account instantly.

4. Once registered, Log into DFP and go to “Inventory”

From the logged in DFP homepage it’s the second option at the top.

DFP Inventory

5. From the DFP Inventory screen click “New ad unit” and then “Web”


New Advert in DFP Inventory


6. Give the new ad unit a name, size and check Adsense is enabled.

You can follow the red arrows below, calling the ad something appropriate – choosing the size “300 x 250” (Social Gallery hasn’t been tested with any other sizes) and double check that you have Adsense enabled. From there you can simply click “Save” at the bottom.
Creating an Adsense Unit for use in  Social Gallery for WordPress

7. Click on the new ad unit

Click on the new ad unit you created (it’ll have the name you chose above.)
Click on the Ad Unit

8. Click “Generate Tags”

Next Click Generate Tags


9. Copy the tags into Social Gallery

Copy These Ad Code Blocks

Social Gallery Will then Work With Adsense!


Social Gallery Using Adsense!
That’s it – your done – you should now have the fantastic combination of Social Gallery Social Lightbox with Adsense Ads – helping you earn more from your content!


  • Jeff
    December 21, 2012

    Thanks for the tutorial. It made setting up ads easy. I appreciate you putting this out so quickly after the release of 2.0, which I just upgraded to this week.

  • Social Gallery Plugin
    January 17, 2013

    No worries Jeff!

  • June 3, 2013

    I would like to buy this plugin but.. How come we can’t use Facebook comments and advertisements at the same time? Is this going to be fixed??


    • Mike Stott
      June 30, 2013

      My understanding is it’s a space issue, that you don’t have much room for both. I’ll look into it and let you know if there’s any other reason

  • December 12, 2013

    where I put The adsense code? I followed All the tutorial Instruction Pictures but ad Is still not Showing……………

    • Mike Stott
      January 13, 2014

      Hi sorry for the delay, comments are not the place to seek support so I imagine we have resolved this now. Please direct all support via the support portal:

  • February 12, 2014

    Wondering if adsense is the only option for ads? I’m sure it can be hacked to run site specific ads (adrotate atm) but is there an option to insert custom ads?
    If not, feature request! Or could we hire you guys to do?

    • Mike Stott
      March 14, 2014

      Yes Adsense is the only option at the current time, other services could be added (anything that can serve Ajax adverts) we don’t plan to add an alternative to adsense in the future so anything would need to be custom.

      • Mike Stott
        March 14, 2014

        Please note – should be where you direct support questions

Leave a Reply to Mike Stott Cancel reply

Your email address will not be published. Required fields are marked *

©2012 Social Gallery Plugin - Please note: Social Gallery Plugin is in no way related to Facebook, Social Gallery is a Gallery Share Plugin for WordPress.