ExactTarget integration
-
I’m trying to integrate a form with ExactTarget. I have tried the ExactTarget plugin but it is out of date and does not support Data Extensions Manager with the Web Collect API which is what the company I work for uses. ExactTarget specifies an errorURL field and a successURL field. I haven’t been able to figure out if there is a return URL that is provided by 3rd Party Integration plugin that is used create the success or the error messages. Our goal is to keep people on our website without sending them to an error or success page.
The documentation from ExactTarget’s Web Collect Data Extension Manager is at https://help.exacttarget.com/en/documentation/exacttarget/subscribers/web_collect/#DEManager.
Thank you for your help.
https://www.ads-software.com/plugins/forms-3rdparty-integration/
-
To clarify I just need to know if there is an url I can pass to ExactTarget for their required fields. For example, another site our company owns uses
_successURL = https://site/path/to/form?success
_errorURL = https://site/path/to/form?errorand then the page processes the response.
After further working with this tool, it looks like the issue is that the service sends a redirect depending upon whether there is a success or failure. More explicitly, if there is an error, the page is redirected to _errorURL and if there the request is successful the page is redirected to _successURL. I have a script which is enqueued for the form which can handle the query, but it looks like the redirect is not passed along. What sort of hook would be needed to allow the redirect to pass through?
*** Service *** Array ( [name] => ExactTarget [url] => https://cl.s6.exct.net/DEManager.aspx [forms] => Array ( [0] => gf_1 ) [success] => [failure] => [timeout] => 10 [hook] => true [dynamic-attach] => yes [dynamic-format] => %s = %s; [mapping] => Array ( [0] => Array ( [lbl] => Email Address [src] => input_1 [3rd] => EmailAddress ) [1] => Array ( [lbl] => Client ID [src] => input_2 [3rd] => _clientID ) [2] => Array ( [lbl] => Data Extension Key [src] => input_3 [3rd] => _deExternalKey ) [3] => Array ( [lbl] => Action [src] => input_4 [3rd] => _action ) [4] => Array ( [lbl] => Success URL [src] => input_5 [3rd] => _successURL ) [5] => Array ( [lbl] => Error URL [src] => input_6 [3rd] => _errorURL ) [6] => Array ( [lbl] => Business Unit [src] => input_7 [3rd] => BusinessUnit ) [7] => Array ( [lbl] => Product [src] => input_8 [3rd] => Product ) [8] => Array ( [lbl] => Referrer [src] => input_9 [3rd] => Referrer ) [9] => Array ( [lbl] => Test [src] => input_10 [3rd] => Test ) ) [separator] => , ) *** Post (Form) *** urlscrubbed Array ( [input_1] => [email protected] [input_2] => data-scrubbed [input_3] => data-scrubbed [input_4] => add [input_5] => https://urlscrubbed/?exacttargetresult=success [input_6] => https://urlscrubbed/?exacttargetresult=failure [input_7] => BB [input_8] => Newsletter [input_9] => https://urlscrubbed/wp-admin/admin.php?page=gf_edit_forms&view=settings&id=1&subview=confirmation&cid=537a5b5dd4e5e [input_10] => TRUE [is_submit_1] => 1 [gform_submit] => 1 [gform_unique_id] => [state_1] => WyJbXSIsImZlMGQwMTFkNzk0MjJmNmI3M2UyZTQxNmVjNjFmNmZhIl0= [gform_target_page_number_1] => 0 [gform_source_page_number_1] => 1 [gform_field_values] => ) *** Post (to Service) *** Array ( [timeout] => 10 [body] => Array ( [EmailAddress] => [email protected] [_clientID] => data-scrubbed [_deExternalKey] => data-scrubbed [_action] => add [_successURL] => https://urlscrubbed/?exacttargetresult=success [_errorURL] => https://urlscrubbed/?exacttargetresult=failure [BusinessUnit] => BB [Product] => Newsletter [Referrer] => https://urlscrubbed/wp-admin/admin.php?page=gf_edit_forms&view=settings&id=1&subview=confirmation&cid=537a5b5dd4e5e [Test] => TRUE ) ) *** Response *** Array ( [headers] => Array ( [date] => Tue, 20 May 2014 01:57:19 GMT [server] => Apache/2.2.26 (Unix) DAV/2 PHP/5.4.24 proxy_html/3.1.2 mod_ssl/2.2.26 OpenSSL/0.9.8y [x-powered-by] => PHP/5.4.24 [expires] => Wed, 11 Jan 1984 05:00:00 GMT [cache-control] => no-cache, must-revalidate, max-age=0 [pragma] => no-cache [set-cookie] => Array ( [0] => wordpress_test_cookie=WP+Cookie+check; path=/ [1] => wordpress_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [2] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [3] => wordpress_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/blogscrubbed/wp-content/plugins [4] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/blogscrubbed/wp-content/plugins [5] => wordpress_logged_in_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [6] => wordpress_logged_in_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [7] => wordpress_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [8] => wordpress_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [9] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [10] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [11] => wordpressuser_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [12] => wordpresspass_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [13] => wordpressuser_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ [14] => wordpresspass_b0db889182f120a32e2bffd2bfbad62a=+; expires=Mon, 20-May-2013 01:57:20 GMT; path=/ ) [x-frame-options] => SAMEORIGIN [content-length] => 4786 [connection] => close [content-type] => text/html; charset=UTF-8 ) [body] => <!DOCTYPE html> <!--[if IE 8]> <html xmlns="https://www.w3.org/1999/xhtml" class="ie8" lang="en-US"> <![endif]--> <!--[if !(IE 8) ]><!--> <html xmlns="https://www.w3.org/1999/xhtml" lang="en-US"> <!--<![endif]--> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>blogscrubbed Blog › Log In</title> <link rel='stylesheet' id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8.2' type='text/css' media='all' /> <link rel='stylesheet' id='dashicons-css' href='https://wp.test1.com/blogscrubbed/wp-includes/css/dashicons.min.css?ver=3.8.2' type='text/css' media='all' /> <link rel='stylesheet' id='wp-admin-css' href='https://wp.test1.com/blogscrubbed/wp-admin/css/wp-admin.min.css?ver=3.8.2' type='text/css' media='all' /> <link rel='stylesheet' id='buttons-css' href='https://wp.test1.com/blogscrubbed/wp-includes/css/buttons.min.css?ver=3.8.2' type='text/css' media='all' /> <link rel='stylesheet' id='colors-fresh-css' href='https://wp.test1.com/blogscrubbed/wp-admin/css/colors.min.css?ver=3.8.2' type='text/css' media='all' /> <!--[if lte IE 7]> <link rel='stylesheet' id='ie-css' href='https://wp.test1.com/blogscrubbed/wp-admin/css/ie.min.css?ver=3.8.2' type='text/css' media='all' /> <![endif]--> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/js/jquery.easing-1.3.pack.js'></script> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/js/jquery.cycle.all.js'></script> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/js/jquery.fancybox-1.3.4.pack.js'></script> <script type='text/javascript' src='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/js/jquery.mousewheel-3.0.4.pack.js'></script> <!-- Private Only --> <style> #loginform { margin-top: 0; } #login h1 a{ display: none !important; } </style> <link rel="stylesheet" type="text/css" href="https://wp.test1.com/blogscrubbed/wp-content/themes/dwfocus/custom.css" /> <!-- Private Only by Kate Mag - @link: https://pixert.com--> <meta name='robots' content='noindex,nofollow' /> <meta name='robots' content='noindex,follow' /> </head> <body class="login login-action-login wp-core-ui"> <div id="login"> <h1><a href="" title="blogscrubbed Blog">blogscrubbed Blog</a></h1> <p class="message">Only registered and logged in users are allowed to view this site. Please login now<br /></p> <form name="loginform" id="loginform" action="https://wp.test1.com/blogscrubbed/wp-login.php" method="post"> <p> <label for="user_login">Username<br /> <input type="text" name="log" id="user_login" class="input" value="" size="20" /></label> </p> <p> <label for="user_pass">Password<br /> <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label> </p> <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> Remember Me</label></p> <p class="submit"> <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="Log In" /> <input type="hidden" name="redirect_to" value="https://wp.test1.com/blogscrubbed/?exacttargetresult=failure&errMsg=An+error+occurred+updating+the+data+extension" /> <input type="hidden" name="testcookie" value="1" /> </p> </form> <p id="nav"> <a href="https://wp.test1.com/wp-login.php?action=lostpassword" title="Password Lost and Found">Lost your password?</a> </p> <script type="text/javascript"> function wp_attempt_focus(){ setTimeout( function(){ try{ d = document.getElementById('user_login'); d.focus(); d.select(); } catch(e){} }, 200); } wp_attempt_focus(); if(typeof wpOnload=='function')wpOnload(); </script> <p id="backtoblog"><a href="https://wp.test1.com/blogscrubbed/" title="Are you lost?">← Back to blogscrubbed Blog</a></p> </div> <link rel='stylesheet' id='wpinstagram-css' href='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/wpinstagram.css?ver=0.5' type='text/css' media='all' /> <link rel='stylesheet' id='fancybox-css-css' href='https://wp.test1.com/blogscrubbed/wp-content/plugins/instagram-for-wordpress/js/fancybox/jquery.fancybox-1.3.4.min.css?1' type='text/css' media='all' /> <div class="clear"></div> </body> </html> [response] => Array ( [code] => 200 [message] => OK ) [cookies] => Array ( [0] => WP_Http_Cookie Object ( [name] => wordpress_test_cookie [value] => WP Cookie check [expires] => [path] => / [domain] => wp.test1.com ) [1] => WP_Http_Cookie Object ( [name] => wordpress_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [2] => WP_Http_Cookie Object ( [name] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [3] => WP_Http_Cookie Object ( [name] => wordpress_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => /blogscrubbed/wp-content/plugins [domain] => wp.test1.com ) [4] => WP_Http_Cookie Object ( [name] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => /blogscrubbed/wp-content/plugins [domain] => wp.test1.com ) [5] => WP_Http_Cookie Object ( [name] => wordpress_logged_in_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [6] => WP_Http_Cookie Object ( [name] => wordpress_logged_in_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [7] => WP_Http_Cookie Object ( [name] => wordpress_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [8] => WP_Http_Cookie Object ( [name] => wordpress_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [9] => WP_Http_Cookie Object ( [name] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [10] => WP_Http_Cookie Object ( [name] => wordpress_sec_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [11] => WP_Http_Cookie Object ( [name] => wordpressuser_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [12] => WP_Http_Cookie Object ( [name] => wordpresspass_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [13] => WP_Http_Cookie Object ( [name] => wordpressuser_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) [14] => WP_Http_Cookie Object ( [name] => wordpresspass_b0db889182f120a32e2bffd2bfbad62a [value] => [expires] => 1369015040 [path] => / [domain] => wp.test1.com ) ) [filename] => )
After doing some research it looks like the issue is with the wp_remote_post() function which passes along the html of the post response instead of redirecting the user to the url which the service sends back. In other words, if I write the html for a form in a WordPress post, the user is redirected to either the _successURL or the _errorURL that the service sends back. With this plugin, which relies on wp_remote_post(), the contents of the url are passed back to the [body] field in the Response array.
The solution I’ve used so far is to create a plugin which, among other things, includes two php files. One is success.php and the other is error.php. Their only content is whatever message I want passed into the [body] field of the response array from wp_remote_post().
This seems to be a limit to WordPress’s HTTP API. The Codex seem to indicate there’s some means to redirect, but so far I haven’t been able to figure it out. It would be a nice feature to have the option to have the user redirected. In the meantime I will mark this issue resolved. It seems that I’ll need to use either a hook in this plugin or with Gravity Forms to process the confirmation message.
Hi, sorry you couldn’t get it figured out to your satisfaction.
You should be able to specify the maximum number of allowed redirects in
wp_remote_post
(see Examples section), which isn’t normally exposed in this plugin but you can use the hook...service_filter_args
to add it in (a la hook #5). This should then go to the success/error urls you specified, unless they haven’t set up proper redirects (not sure if they have, because usually theresponse_code
is 30x for a redirect, rather than the 200 reported here).I did notice this field appearing in the response body —
<input type="hidden" name="redirect_to" value="https://wp.test1.com/blogscrubbed/?exacttargetresult=failure&errMsg=An+error+occurred+updating+the+data+extension" />
I didn’t see
exacttargetresult=success
also in the response, so maybe you could simply set the plugin “success condition” to look for that instead? If you wanted to report theerrMsg
you’d have to use hook #6 to parse the response body for the message and report it back.Sorry, I didn’t see your reply until now. What I did was set the success condition to “success”. The only content for success.php was the word “success”. So upon success, that was the only word in the
[body]
portion of the response.
- The topic ‘ExactTarget integration’ is closed to new replies.