Closed pw3010 closed 9 years ago
These issue threads are technically supposed to be for problems with the plugin code, or requests for enhancements, but I understand not knowing where else to go. The Wordpress support forums for the plugin are more appropriate, but since they don't send the author emails by default it's harder to get an "official" response, and you're more at the mercy of whichever kind soul stumbles upon your problem.
Now that that's out of the way, to your question:
ClickDimensions' setup is almost ideal for this plugin, except for the fact that you need a cookie value and setting a header, which I don't support out of the box. I ended up putting all the "unusual" field values in another add-on for this plugin, Dynamic Fields, which would be a great place to add support for cookies (now it's an Issue).
For now, you'll want to hook to service_filter_post
(actually Forms3rdpartyIntegration_service_filter_post
) and grab the cookie value, something like:
add_filter('Forms3rdPartyIntegration_service_filter_post', 'my_extension_cookie_post_filter'), 10, 3);
function my_extension_cookie_post_filter($post, $service, $form) {
$post['cd_visitorkey'] = $_COOKIE['cuvid'];
return $post;
}
Adding headers is somewhat similar -- you can already do this with another add-on Forms 3rdparty Xpost, but if you want to do it with the same hook as your cookies, you can use service_filter_args
and modify both the body
and the headers
keys (same as xpost):
add_filter('Forms3rdPartyIntegration_service_filter_args', 'my_extension_modify_request'), 10, 3);
function my_extension_modify_request($args, $service, $form) {
$args['body']['cd_visitorkey'] = $_COOKIE['cuvid'];
// just in case there are already headers...
if(isset($args['headers'])) {
$args['headers'] = array_merge( (array)$args['headers'], $headers );
}
else {
// here, set it to the current page via `get_permalink()`
// or one of the fields you mapped in `$args['body']`, or a static value
$args['headers'] = array( 'Referer' => $args['body']['some_field_i_decided'] );
}
return $args;
}
Hi Zaus, thanks so much for getting back to me on this. I'll give the filters a try.
Pete
Hi,
I'm trying to integrate a Contact Form 7 form with an MS Dynamics/ClickDimensions form capture. I've used 3rd Party Integration before with SFDC and been successful with that, but I'm having no joy with Dynamics.
The post here suggests that I need to do this including a Visitor Key (a value from a cookie) and the Referrer Header, and I can't work out how to add them into the 3rd Party Integration submission.
Does anyone know how to do this, or have any examples of where they have done something similar?
Forgive me if I'm posting in the wrong place, but this is a bit of a last ditch attempt to get something working...
Thanks for any help given.
Pete