Can I have a Adsense fallback on Google Ad Manager only if a variable is set or something? - adsense

On my site, I serve ads to both visitors/free members and paid accounts. The ads are served with Google Ad Manager.
In the case of visitors/free members, I would like to fall back on Adsense if there is no Ad Manager ad to display.
In the case of paid accounts, I would like to fall back to a house ad.
Is this possible somehow?

You can do this :
if user is loggued, add a key member=true to your GPT page level targetings.
then target your adsense line items to the inventory with key member=true only
To define page level key/values :
googletag.pubads().setTargeting('member', 'true');
Just keep in mind setTargeting only accepts strings or array values as detailed here (bolean or integer won't work)
Here is how to set your Adsense campaign up in Google Ad Manager.

Related

Fetching comments from active facebook ads

I am working on a Facebook comment manager and I just can't manage to get only active ad creatives from Facebook API.
Is there a way to get all ad creatives filtered by their status?
I can't afford to check all ads manually, because I plan to pull ads every few minutes and I would be hitting Facebook's rate limit.
There are a number of endpoints that could help you do this, but would require you to make multiple API calls.
Step One: Get all Ads
Assuming you have managed to get the Ad Account ID from a previous API call, you will be able to get all Ads running against that account by making a GET request to the /act_{ad_account_id}/ads?fields=name endpoint.
Step Two: Get Images with Active Status
Next you can call the /{ad_id}/adcreatives?fields=name,image_hash,status endpoint for each Ad, which will return the name of the creative, the image hash that was used, and the status of the creative.
If you require the status of the actual Ad itself rather than the status of the creative, you will need to do another step in between Step One and Step Two, where you call /{ad_id}?fields=name,status on each Ad, then filter ACTIVE campaigns.
EDIT:
You can use /act_{ad_account_id}/adcreatives?fields=status,image_hash,title to get all creatives and statuses associated with the account. This would reduce your API call rate although would mean you would need to sort the creative to match with the ads. Using the title field would give the title of the ad it was used in the ad. Facebook does not offer any other fields related to the ad itself.
You can limit results to ads whose effective_status is ACTIVE.
Here is a sample request:
act_123/ads?filtering=[{"field":"effective_status","operator":"IN","value":["PAUSED"]}]
Ad fields
Insight Parameter

How to determine if users with different home domains are part of same google apps org?

In Google Apps, there is always a base/primary organization. But Google Apps can have subdomains and suborganizations both (or combination of those).
We want to be able to identify the currently logged-in user as being part of the overall organization, whether it be the primary org/domain or some subdomain or suborg. But when you get user info or license info, it returns the home domain of the currently logged in user as the ID for their organization. No ID is consistent across all subdomains or suborgs.
I've also tried listing all orgs using the organization apis, but that doesn't seem to work when trying to get the org info of the root org: https://developers.google.com/admin-sdk/directory/v1/guides/manage-org-units
Is there a way, given a particular Google Apps user, to determine what the primary organization is?
The only alternative we have is to treat every domain/subdomain in the Google Apps org as it's own independent org. This is less than ideal because now a Google Apps admin who manages all of their sub-orgs/subdomains in one place in Google will now have to manage a separate organization in our app for each domain in their overall org. This uses up extra resources in our system for creating these additional orgs, but more importantly creates a very confusing organization/user management model.
When you look at the Users resource for the two users, compare the customerId attribute. If they match, the two users are in the same Google Apps account. If they don't they're not.
Also, don't assume two logged in users are in the same Apps account. One could be an Apps account and one could be a consumer account even though they have the same SMTP domain.

Google Groups: Retrieve list of groups for a user

Is there an API to get the list of all Google groups a user is part of (of course, with his/her permission) and vice versa (given a Google group, get all users part of that group).
The Google Apps Provisioning API lets you retrieve the current memberships for a Google Apps user as well as list all members of a Google Apps Google Group. However, there is no way to do this for consumer (#gmail.com) Google Accounts and regular (#googlegroups.com) Google Groups.
Also it need not be Google Apps Provisioning. They also have gdata Services and retrieve Groups function. For example
if you have an user example#domain.com, then you can use RetrieveGroups(String memberId, bool directOnly) where memberId is the email address and directOnly must be set to True. This works sleek.

Multiple adsense publisher id's mixing and matching etc

Does anyone know the adsense TOS regarding using more than one publisher ID
on a site.
can a page have 1 ad using publisher ID#1 and another ad using publisher ID#2
i.e the top banner ad is using one pubid and the bottom banner ad is using another
pubid
This is important as I have been noticing some very strange results lately, but
I want to make certain what I am doing is 'legal' before saying more..
You are allowed to have multiple Adsence id's on the same site, even the same page as long as the total number of adds per page is not exceeded (I don't think extra adds will show up if you have more than 3 anyway.)
There are a number of sites around that allow you to include your Adsence ads with your content. Take a look at these:
www.weebly.com
www.hubpages.com
www.triond.com
More...
Its 100% allowed to use more than one publisher ID on a single page or across a website provided the total number of ad units per page is not exceeded (that per page not per account.)
http://productforums.google.com/forum/#!topic/adsense/eBwPjDixtUY
The answer is that yes, we do allow this. But before you place your ad code on the same page or site as another publisher, here are a few important points to keep in mind:
The maximum number of products per page will remain the same.
If you don't own the site, you'll need to receive permission from the site owner to display your ads on their pages.
We're unable to divide earnings between accounts, so any revenue generated will be credited to the account associated with the ad unit that was clicked or viewed.
Any shared site that displays Google ads must also comply with our program policies.
You're responsible for the content of any page where your ad code appears. Before placing your ad code on another publisher's site, we recommend reviewing the site for any policy violations.
And one final tip before giving your code to another publisher -- try using our Allowed Sites feature to monitor where your ads are appearing and keep your account in good standing.
http://adsense.blogspot.com/2008/07/sharing-your-ad-space.html

is it possible to integrate my custom logging system to google adsence ad tag

i have a custom logging system,
my client provide me a script of google adsence ad tag
(which using domain http://adserver.adtech.de/addyn/ with ad tag id and other staff )
and i want to track how many clicks on this ad tag
So i need to integrate my custom logging system to google adsence,
by using some parameter like in double click or other 3 rd party media company
is it possible to do that?
I think you would be better of using the Adsense API to retrieve this information http://code.google.com/apis/adsense/management/v1/reference.html#collection_reports
I don't know what success you'll have trying to intercept the click event on the ads. Even if you could get it to work (which is unlikely as it's rendered from a different domain) Google would likely ban you for tampering with the ads