Passing Information to DFP by using Patterns
Introduction
Sometimes, you need to be able to pass variables into your Creative. Unfortunately,
DFP Small Business doesn't support this very well. That's not to say that they don't
support it, they do. But the limitations on how they support can make it unusable in
some circumstances.
The Pattern Method
Utilizing the tagging system in DFP, you can tag pages with certain attributes. You can
also pass these attributes values into your Creatives (Third Party) by using the Pattern
Macro (%%PATTERN:attribute name%%). ((login for URL))
There are two methods of doing the Pattern method. You can use use the attributes as
a actual value or a superficial value. You can also mix and match these methods.
Actual Usage
Actual usage refers to the fact that the Attribute that is put on the page has an actual
purpose on the page. For example, you might tag a webpage with "Type = Sports". This
has an actual value that you may want to use in targeting your Line Items.
Example:
Add the following Javascript in your DFP Header Tag. Find:
and add above:Code:Please ((login for URL)) to see this code!
The above code puts an attribute "Passing" with the value "Pattern".Code:Please ((login for URL)) to see this code!
The Line Item settings is:
And the Creative:
<div style="width:300px; height:250px; padding: 20px; border: blue solid 2px;">
<p>DFP Passing attribute should have the value of "Pattern" and is actually: %%PATTERN:Passing%%</p>
</div>
Which gives us a Creative 300x250 in size with a Blue border with text inside it showing what information has been passed to it (in this case, it should be word "Pattern"):
Superficial Value
Superficial value allows you to pass information without impacting anything else.
For example, I might use a attribute called "Info". "Info" has no purpose in determine what
Line Item should be shown so all Line Items will use the criteria "Info DOES NOT EQUAL
AAAAAA" (AAAAAA being a value I will never use). Then you can pass whatever
information to the attribute "Info" and use the the appropiate Macro in DFP to access
that data.
Here's a quick example:
Add the following Javascript in your DFP Header Tag. Find:
and add above:Code:Please ((login for URL)) to see this code!
The above code puts an attribute "Passing" with the value "Undefined" as default.Code:Please ((login for URL)) to see this code!
Take a look at the bottom of the page where the actual ad is shown and see the data
being passed into the Creative
The Line Item settings is:
I have the Targeting criteria set so that the Line Item will show when it's NOT "Passing" or
"Javascript". You can use whatever value you want. The reason I want it to be not
"Passing" or "Javascript" is because I have Line Items for those two already. So, this Line
Item will show on all pages which have the attribute "Passing" on it and has a value that
does not equal to "Passing" or "Javascript".
You may wish to simply create a Free-Form Custom Targeting
(Inventory -> Custom Targeting -> New Key -> Values = Can I pass custom variables into a tag?).
And in your Line Items, make it so that the key does not equal a value you won't use
(so that it will effectively deliver on all your pages since that condition will always be true).
And the Creative:
<div style="width:300px; height:250px; padding: 20px; border: red solid 2px;">
<p>DFP Passing attribute has the value: %%PATTERN:Passing%%</p>
</div>
Which gives us a Creative 300x250 in size with a Red border with text inside it showing
what information has been passed to it via the attribute "Passing":
Conclusion
You can utilize this knowledge to pass in information to your Creative. You can mix and
match both methods, utilize Javascript or a server-side language such as PHP to create
a fairly flexible system of passing important information.


Results 21 to 30 of 101
- 12-27-10, 12:14 #21
- Gender
- Age
- 42
- Country
- Germany
- Join Date
- 10-27-10
- Posts
- 836
Passing Information to DFP by using Patterns
- 01-16-11, 05:40 #22zargaiGuest
You are so genius mate. Very great web site with nice tutorial. i am very new to DFP i just added adsense via DFP lets see how it works.
Thanks Admin you are great
- 01-16-11, 14:10 #23zargaiGuest
Hello Admin
thanks for making such a helpful site, i have joined the DFP and now i got few questions from you if you can answer that will be great.
The inventory earning in DFP will be paid to adsense account ? or is there any payment option in DFP i coudnt find any.
and i can see i have got paid more in DFP but if i login to Adsense account the figures are very low.
how this all works where i will be getting paid ? DFP or Adsense Account ? and why both have different figures ?
Please help
Thanks
H Afridi
- 01-16-11, 14:37 #24
- Gender
- Age
- 42
- Country
- Germany
- Join Date
- 10-27-10
- Posts
- 836
DFP Small Business is an Ad Server not an Advertising Program like AdSense.
So if you sell Ads on your site directly and put them into your DFP AdServer
then you have to get payed from the Advertiser directly.
I don't really understand what you mean with AdSense paying more in DFP then in AdSense.
DFP (if AdSense is served as third party creative like described in my tutorial here) is not
able to count clicks and earnings from AdSense just impressions.
To see what you earned in AdSense you have to go to your AdSense account.
Also you should read this: ((login for URL))
- 01-16-11, 15:12 #25zargaiGuest
Thanks for your response ok i got ur point now.
one more thing sir why the impression figures in DFP are not the same as adsense account?
DFP Adsense Impression = 8,855
Adsense Account = 4,211
so how this works?
Thanks
- 01-16-11, 15:16 #26zargaiGuest
And also let me tell you. I have a very big Arab Music Site. What are the high pay keywords or channels ? my cpc=.10usd now a days
can you help me increasing it?
my site is ((login for URL)) let me know what to change?
Thanks
- 01-16-11, 15:27 #27
- Gender
- Age
- 42
- Country
- Germany
- Join Date
- 10-27-10
- Posts
- 836
For your first question:
Are you sure you are seeing "Ad unit impressions" in your AdSense Report or "Page Views"?
Pageviews are only counted for the first Ad Unit. See this thread for more information:
((login for URL))
In regards to your second question, please use our ((login for URL)) for this kind of requests. You can ask for a review after you have been registered for 7 days and made at least 10 posts.
- 01-21-11, 20:51 #28jfuquaGuest
This is the best tutorial I've found for this so far. Many thanks. I can't say I fully understand everything yet which is the reason for this post.
Currently, I chain my networks. Network A default to Network B, etc. This is based usually on the average CPM of each.
I assume I will need to removed all defaults from each network so that, if the first network DFP goes to isn't going to fill the space, it'll go to the second option. Is this correct?
Thanks.
- 01-21-11, 21:44 #29
- Gender
- Age
- 42
- Country
- Germany
- Join Date
- 10-27-10
- Posts
- 836
I don't really quite get your question. Do you switched from a different
Ad Server like OpenX to DFP or did you do the Network Chain with DFP?
You can set CPM prices for you campaigns in DFP and let AdSense to compete with them.
- 01-21-11, 21:59 #30jfuquaGuest
Sorry for the confusion. I'm somewhat new to all this. I may be a bit confused as to what DFP does. Let me explain in a bit more detail.
Right now, I have five ad networks chained together through the networks themselves. If Network A doesn't fill the space, it defaults to whoever I have at Network B and so on. With five networks chained together, I think it sometimes slows the site.
Since I now have a non-network advertiser I am wanting to mix in, I am looking at DFP or something which allows me to do this.
So my question is whether I need to add creatives for all my networks or just my top network and any non-network advertisers. If I need to add creatives for all, does DFP automatically try to send to the top tier, then two, etc.? If it does, wouldn't I need to remove my defaults at the various networks and replace with some special code sending it back to DFP?
Thanks.Last edited by jfuqua; 01-21-11 at 22:10.