Hi
I've enabled "Expose node type as atttribute" and some vocabularies as attributes, but I don't see the any GA_googleAddAttr in HTML. Please help me passing arguments to DFP.

CommentFileSizeAuthor
#4 Screen shot 2011-02-22 at 14.22.37.png95.88 KBAnonymous (not verified)

Comments

jcisio’s picture

Status: Active » Fixed

Please test with the latest -dev version.

Anonymous’s picture

Version: 6.x-2.2 » 6.x-2.x-dev

Didn't worked. I see the following code only:

<script type="text/javascript">
<!--//--><![CDATA[//><!--
document.write(unescape("%3Cscript src='http://partner.googleadservices.com/gampad/google_service.js' type='text/javascript'%3E%3C/script%3E"));

//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
GS_googleAddAdSenseService("ca-pub-2987861169402469");
GS_googleEnableAllServices();

//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
GA_googleAddSlot("ca-pub-2987861169402469", "skyscraper_secciones");
GA_googleAddSlot("ca-pub-2987861169402469", "lateral_derecho_inferior");
GA_googleAddSlot("ca-pub-2987861169402469", "lateral_derecho_inferior_90");
GA_googleAddSlot("ca-pub-2987861169402469", "lateral_derecho_superior_90");

//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
GA_googleFetchAds();

//--><!]]>
</script>
jcisio’s picture

Title: Don't passing arguments » Node type and terms are not exposed
Component: Code » Documentation
Status: Fixed » Active

Go to the GAM settings page, there are a few options for that.

The documentation (in both README and handbook page) is poor, feel free to suggestion any change.

Anonymous’s picture

StatusFileSize
new95.88 KB

I think I've activated them well. Check the attachment.

jcisio’s picture

Component: Documentation » Code
Category: support » bug

Ok, it looks like a bug, but I'm not sure if I can reproduce this. Do you have any other modules? Are you using a module that override the node render page (like Panels or a module using CTools page manager)?

Anonymous’s picture

Yep, I have CTools, Panels, Display Suite running on latest versions

jcisio’s picture

Put this somewhere in the .module file and test:

/**
 * Implementation of hook_ctools_render_alter().
 *
 * When using Panels module (CTools Pagemanager), hook_nodeapi (view) is not
 * being called. Use hook_ctools_render_alter() instead.
 */
function google_admanager_ctools_render_alter($info, $page, $args, $contexts, $task, $subtask) {
  if ($task['admin path'] == 'node/%node' && $page) {
    google_admanager_nodeapi($contexts['argument_nid_1']->data, 'view', NULL, $page);
  }
}

It is untested, but it should work.

Anonymous’s picture

Status: Active » Fixed

Brillian! It worked. Thank you very much. Will you add this to future versions?

BTW, do you know a way to pass these arguments from Panel Pages?

jcisio’s picture

Title: Node type and terms are not exposed » Compatibility with Panels
Category: bug » feature
Status: Fixed » Reviewed & tested by the community

I'll commit this fix into CVS later and it will be included in future versions.

jcisio’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

I totally forgot about this one and it missed 6.x-2.3 release! However I've just committed this patch. Switch to D7 branch where Panels is still in alpha stage.

jcisio’s picture

Status: Patch (to be ported) » Postponed

Even the feature does currently not exist in D7 (the port was not complete), so I postpone.

jcisio’s picture

Title: Compatibility with Panels » Expose node type as atttribute: incompatible with Panels
Darren Shelley’s picture

To anyone landing here hoping for a d7 solution this works:

/**
 * Implementation of hook_ctools_render_alter().
 *
 * When using Panels module (CTools Pagemanager), hook_node_view is not
 * being called. Use hook_ctools_render_alter() instead.
 */
function google_admanager_ctools_render_alter($info, $page, $context) {
  if ($context['task']['admin path'] == 'node/%node' && $page) {
    google_admanager_node_view($context['contexts']['argument_entity_id:node_1']->data);
  }
}
Anonymous’s picture

Does the latest 6.x-2.x-dev includes this patch?

jcisio’s picture

IIRC and what I said in #10 is right, this issue is fixed in 6.x-2.x-dev.

For 7.x, #1251882: Targeting specific taxonomy terms should get in before this issue. Thanks to Darren, but I really don't have time right now and it needs someone else review.

axel pressbutton’s picture

The solution highlighted by Darren in #13 works for me but It throws the following notice in php5.3:

"Notice: Undefined index: admin path in google_admanager_ctools_render_alter()"

So i have ammended the code to check whether admin path is set before validating whether it matches node/%node:

/**
 * Implementation of hook_ctools_render_alter().
 *
 * When using Panels module (CTools Pagemanager), hook_node_view is not
 * being called. Use hook_ctools_render_alter() instead.
 */
  if (isset($context['task']['admin path']) && $context['task']['admin path'] == 'node/%node' && $page) {
    google_admanager_node_view($context['contexts']['argument_entity_id:node_1']->data);
  }
}
jcisio’s picture

Status: Postponed » Reviewed & tested by the community

RTBC from #13 and #16.

What I said in #15 about #1251882: Targeting specific taxonomy terms is not correct, because at least we can already expose node type...