views:

319

answers:

2

I would like to have a Google Adwords conversion trigger when a new node is submitted on my Drupal 6 site, but cannot find a way to do this.

Basically I want a user to submit some details into a custom node type, let's call it "Player". When a new Player is added, I want to trigger an Adwords conversion. I have looked at the Custom (Form) Destination module, but this doesn't seem to work for this form. Even if it did work, I'd have to somehow cleverly distinguish between new submissions and edits because they have the same form_id.

Anyone have experience of something similar to this and can offer any advice?

+2  A: 

This is likely going to take a small bit of coding in a custom module.

I would recommend creating a hook_node implementation which fires when a node is being created. It then fires off the adwords conversion.

Something like:

function mymodule_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  if ($op == 'insert' && $node->type == 'whatever_content_type') {
    // Code to trigger adwords conversion.
  }
}

If you need help creating a custom module, I would suggest you visit the Drupal Development IRC Chatroom at #drupal on irc.freenode.net. Someone there would be happy to help you get started!

BrianV
Thankss BrianV... I may well appear there soon :)
x3ja
A: 

In the end it turns out they wanted it just when someone used the contact form, so I created a webform (using webform module) for my contact form and then used php code in the thankyou page to achieve this.

x3ja

related questions