Integrating a custom built form with a subscriber list provider (Aweber) - wordpress

I have created my own form because every other form out there for WordPress is horrible.
div class="exc-form">
<form action="action_page.php">
<fieldset>
<div id="form_jgrsh">
First name:<br>
<input type="text" name="firstname" placeholder="Please enter first name">
<br>
Last name:<br>
<input type="text" name="lastname" placeholder="Please enter last name">
<br>
Email:<br>
<input type="text" name="email" placeholder="Please enter email">
<div class="chk_bx">
<input type="checkbox" name="concent" value="agree">By entering my information and pressing submit I agree to subscribing to the Stockhouse AND Junior Gold Report (please check box before submiting)
<br>
</div>
<input type="submit" class="submit-btn" value="Submit">
</div>
</fieldset>
</form>
It's super simple and isn't anything special. I'm under the impression PHP will be needed as well.
I use Aweber as my list provider, and I've contacted them for support and they want me to use their horrible, ugly form builder, and won't help me integrate my own form to use their list.
I've never done something like this before, so I'm looking for some guidance on how to send subscriber information to a list. Aweber offer's a list ID and most plugins I've seen require a Aweber authentication before Aweber links up to the list.
https://labs.aweber.com/snippets/lists - this is as closest to the resources I could find from Aweber.
Here is the authentication list: https://labs.aweber.com/snippets/authentication

Related

Wordpress search form by category not working?

Objective
I am trying to create different search forms for two different landing pages. Thus, users who end up on landing page A will only be able to search for products with categories Man and Book. Users landing on page B will only be able to search for products with categories Beast and Funny.
Here is my example setup in WooCommerce.
What I have tried
Based on this link, I have tried the following search function for page A.
<form role="search" method="get" id="searchform" action="https://test.com/">
<div>
<label for="s">Search for (Man and Book):</label>
<input type="text" value="" name="s" id="s" />
<input type="hidden" value="1" name="sentence" />
<input type="hidden" value="product" name="post_type" />
<input type="hidden" value="product_cat" name="man,book" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
Problem
If I key in GetAllX into the search form, I expect to see GetAllX (Copy 2) only. Instead, I see GetAllX (Copy 2) and GetAllX.
Also, when I key in test, I expect to see Test product 2 only. Instead, I see both Test product 2 and Test Product.
Questions
Why is WordPress behaving like this? Can someone help me out with this, please?
If there is an easier way to create search forms for different product categories based on landing pages, please do let me know.
Found the error. It was in this line:
<input type="hidden" value="product_cat" name="man,book" />
It should be instead:
<input type="hidden" value="man,book" name="product_cat" />
There was a typo in the article I linked to.

Logging in and scraping a site like ft.com with BeautifulSoup

I have this url: https://www.ft.com/content/87d644fc-73a4-11e7-aca6-c6bd07df1a3c
It corresponds to an article that requires signing up. I signed up and can see the content in my browser. However when I use this code with the url above:
soup = BeautifulSoup(urllib2.urlopen(url), 'lxml')
with open('ctp_output.txt', 'w') as f:
for tag in soup.find_all('p'):
f.write(tag.text.encode('utf-8') + '\n')
Especially, it redirects me on the signup page. Is there any way to be logged in to have access to the article when scraping?
Here are the basics.
Go to the login page. If you use the Chrome browser you can position your mouse over the email input area and use the context menu (in Windows) and then its 'Inspect' entry to reveal the form element that will be used to submit your email address. It looks like this.
<form name="enter-email-form" action="/login/submitEmail" class="js-email-lookup-form" method="POST" data-test-id="enter-email-form" novalidate="true">
<input type="hidden" name="location" value="https://www.ft.com/content/87d644fc-73a4-11e7-aca6-c6bd07df1a3c">
<input type="hidden" name="continueUrl" value="">
<input type="hidden" name="readerId" value="">
<input type="hidden" name="loginUrl" value="/login?location=https%3A%2F%2Fwww.ft.com%2Fcontent%2F87d644fc-73a4-11e7-aca6-c6bd07df1a3c">
<div class="lgn-box__title">
<h1 class="lgn-heading--alpha">Sign in</h1>
</div>
<div class="o-forms-group">
<label for="email" class="o-forms-label">Email address</label>
<input type="email" id="email" class="o-forms-text js-email" name="email" maxlength="64" autocomplete="off" autofocus="" required="">
<input type="password" id="password" name="password" style="display:none">
<label for="password">
</label></div>
<div class="o-forms-group">
<button class="o-buttons o-buttons--standout o-buttons--big" type="submit" name="Next">Next</button>
</div>
</form>
You will need to gather the action attribute from the form element and all the name-value pairs from the input statements. You use these in a POST request with the requests library.
You do this once for your email address and once for your password. Then you should be able to issue the GET for the URL with requests.
I must warn you that I haven't actually tried this with that particular site.
If you are to scrape a website using BeautifulSoup, I'd recommend the MechanicalSoup library. It is a very lightweight layer on top of BeautifulSoup (to parse HTML) and requests (to fetch pages), but it will deal for you with things like filling-in a form properly (i.e. what you need here), following relative links, ...
MechanicalSoup is also limited in the sense that it doesn't interpret JavaScript code, hence won't work on a website relying on JavaScript, but it reduces the manual effort compared to using BeautifulSoup and urllib or requests directly.
(Note: I'm one of the authors of MechanicalSoup)

Analytic funnelling, tracking two URLs with different parameters, both being triggered as the same URL.

I want to be able to track goals but I need to know whether they came from a page with a social media parameter or a digital marketing parameter in the URL.
I currently have subscription form which returns a URL with a specific parameter depending on which page we're on. We're using wordpress.
<?php if(is_page( 'internet-marketing-software')): ?>
<div class="free-trial" style="display:none;">
<div class="sign-up-button" style="/* display:none; */">
<form name="signup" id="signup" action="http://dmtrk.net/signup.ashx" method="post" onsubmit="return validate_signup(this)">
<input type="hidden" name="addressbookid" value="1922561">
<input type="hidden" name="userid" value="52978">
<input type="hidden" name="ReturnURL" value="http://test-site.com/?signup=false&step2=true&digital-marketing=true&form=form-banner">
<input id="input" type="text" name="Email" placeholder="name#email.com">
<input type="hidden" id="double" name="double" value="double">
<input id="submit" class="banner" type="Submit" name="Submit" value="sign up">
</form>
</div>
<div class='trial-desc'>
<p>Interested? <span>Start 30 day FREE trial now!</span>
</p>
</div>
</div>
<?php endif; ?>
I load a similar piece of code in the header this time with the condition
if(is_page( 'social-media'))
and which returns the url
http://test-site.com/?signup=false&step2=true&social-media=true&form=form-banner.
I so depending on the page each user gets taken to either the social-media or digital-marketing page.
When this URL us triggered a double opt-in email is sent with a link taking them to the true goal page http://test-site.com/?signup=true.
In Google Analytics I have set up two goals with the funnelling capability turned on.
I currently have the destination setup as:
RegEx /?signup=true
Funnelling On
Step &digital-marketing=true
And then for social:
RegEx /?signup=true
Funnelling On
Step &social-media=true
Looking at my reports each time a goal is triggered, no matter which URL was used they both register as a goal.
I'm not sure what I'm doing wrong, is there something I'm overlooking with Analytics and URL parameters?
To follow up on the comments (I cannot comment) - You should mark the previous page (coming from digital marketing or social) as "required step" to make sure that the goal will register in one of the paths, and not both. See the button on the right.

Text Input Types with Gravityforms

I currently build a complex form with gravityforms. What i need is an area where i have some text and in between the text are some input-fields to complete the text paragraph.
EXAMPLE.
I,"name-inputfield"____, agree to be available between__"text-inputfield"__ and ____.
I already created that in a html editor and placed the code into a HTML Box of Gravityforms but if submit the information are not delivered. I believe i forget something inside the formcode.
I attached the code below
I, <input type="text" name="" value="NAME" size="40">(for myself and my heirs and legal representatives) of<br>
<input type="text" name="" value="STREET ADDRESS" size="40"><input type="text" name="" value="CITY" size="20" maxlength="20"><input type="text" name="a78" value="ST" size="2" maxlength="2"><input type="text" name="" value="ZIP" size="10" maxlength="10"><br>
hereby release Blanca's house Corp., its agents, representatives, directors, employees, contractors, insurers, and members from any and all responsibility and liability involving arising out of, or related to the planned medical mission scheduled to <span class=""><input type="text" name=" " value="" size="20" maxlength="20">starting on <input type="text" name="" value="" size="20" maxlength="20"> through <input type="text" name="" value="" size="20" maxlength="20"> 20<input type="text" name="" value="" size="2" maxlength="2">, including (without limitation) liability regarding my health or safety or my personal property.
Would be great if anybody could help me, because i never did something like this.
Here is also a screenshot of how it looks inside the browser http://awesomescreenshot.com/01e2la0ibc
Thanks a lot for any help
Inputs inside the content of the HTML field will not be captured by Gravity Forms. They aren't "registered" by Gravity Forms so it doesn't know they exist.
There are two alternatives for what you are trying to accomplish.
You can add the fields via Gravity Forms and then style them to be inline. Here is a great example of how this can be accomplished:
http://www.rocketgenius.com/gravity-forms-mad-lib-style-form-demo/
You can add the fields via Gravity Forms and then output the submitted values in an HTML field on a second page. Here is a example of this using my product GP Preview Submission: http://demos.gravitywiz.com/gp-preview-submission/

Why are my html5 labels not displaying in Live Web Preview?

I added this (taken straight from a book, "HTML5 24-Hour Trainer") to Default.aspx in an asp.net web project:
<form method="post" action="">
<fieldset>
<legend>Personal details</legend>
<p>
<label for="Name"> Name:</label>
<input type="text" name="name" id="Name"/>
</p>
<p>
<label for="Email"> Email:</label>
<input type="text" name="email" id="Email"/>
</p>
<p>
<label for="Tel"> Telephone:</label>
<input type="text" name="tel" id="Tel"/>
</p>
</fieldset>
<p>
<input type="submit" value="Submit"/>
</p>
</form>
The labels ("Name:", "Email:", and "Telephone:") are not displaying next to the text input controls (edit boxes) - or anywhere else (visible to me) for that matter if I select "Live Web Preview" (Ctrl+Alt+Enter). However, if I select View In Browser (Ctrl+Shift+W), I can see the labels.
And if I look at the page in any of my three options (Google Chrome, Internal Web Browser, or Internet Explorer), it works fine; it is only the Live Web Preview that is busted.
So the question is, why are the labels invisible with "Live Web Preview"? But I guess I'll just avoid that viewing option; no big deal.
Tried the exact same thing and it works as expected. I guess it's a local issue. Need more info.

Resources