• Hello Sir,
    My URL is https://www.whatvwant.com. I am using customizr child theme. I want to use Google DFP for managing ads. Google DFP generated two tag codes, one code to be pasted in <head> section and another code to be pasted in <body> section.
    Please tell me how to place these two tags in <head> and <body> section. I want to display ad in right sidebar widget.
    If there are any snippets, kindly provide me. Otherwise suggest me any best plugin to use google dfp.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I suspect it’s an either/or, so you shouldn’t add both.

    This snippet will probably work for you to get it in the <head>.

    Otherwise (if you want to get it in the <body> instead), you can probably just paste it into a page (make sure you have the text tab active—don’t switch to the visual tab, which will screw things up).

    Thread Starter whatwewa

    (@whatwewa)

    Sir, I am using this snippet for google analytics code. Will it work if I use second time.
    Because I have placed dfp code in the snippet and changed function name to my_dfp instead of my_analytics. I have placed dfp’s second code in text widget. But it did not work.
    Are there any changes I need to make to this snippet? Could I use same snippet second time without changes?

    You’re right. You need both sets of code.

    Did you change the my_analytics in both the function name and the filter?

    Could you paste (in `backticks`) exactly what you’ve added to the <head> in your functions.php?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to insert Google dfp tag’ is closed to new replies.