Kind time of day to all of you, dear visitors.
If you use theΒ Landing site to sell your products or services, then surely you have questions like how you can keep records of your sales in a convenient table, that is, how to make sure that you have a full list of orders that you can analyze and manage it, and not just receive letters to mail with orders that are not only not convenient to analyze and often lost , get in a spam, come with a delay, or else what is the trouble with them will happen, and in the end you lose your customers .
And here to help us come a different CRM system, connecting it to your site you will receive orders in a convenient admin panel where you can edit the order, change the status, analyze it, etc. ...
Therefore, we will use the API code provided by leadvertex.ru , and then we will have a beautiful form on the site just like we need...
The network has a huge number of different CRM systems, and all of them have no meaning, today we'll talk about the CRM systemΒ leadvertex.ruΒ , since I have been working with it for a long time.
But the essence of the article is not even in the CRM system, in detail about it you can read the information on their site, today I want to give you instructions on the exchange of orders of your Landing Page and this CRM API method.
Most recently, I was approached by one of the customers who just got tired of processing orders in the mailbox, okay even when 5-10 orders, you can process it in the mail, and if you have 50-100 orders, or even more, you imagine what confusion here is obtained ....
So I asked him to connect the above CRM.
You can connect this system even without the API codeΒ for sending orders from our site leadvertex.ru,Β the given system can offer you a script of the ready-made form that you insert by the method of the frame, but this method is not very suitable because the frame is the one the system provides and their form does not always fit the design of your site.
Okay, I will not go around in circles and describe what you know, but we'll start connecting the API CRM systemΒ to our site.
And so, any form of the application or order on the site should be composed from two points, this is the form that the client fills in, and the page of the successful order, the application that the user sees after it is successfully sent.
The first thing we need to do is to configure the application form itself, I will not describe what and how I think you will understand, but simply post the ready-made examples, and if you have any questions, you can specify them in the comments.
1 - The application form looks like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
<form action="call.php" method="post"> <div><input type="text" name="fio" placeholder="Enter Name" required=""></div> <div><input type="text" name="phone" placeholder="Enter phone" required=""></div> <input type='hidden' name='referer' value='<?=isset($_POST['referer'])?$_POST['referer']:(($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'');?>'> <div><input type="hidden" name="price" value="2990 Π³ΡΠ½."></div> <div><input type="hidden" name="goodID" value="00000"></div> <input type="hidden" name="source" class="source" value="<?php echo isset($_GET['utm_source']) ? $_GET['utm_source'] : '' ;?>" /> <input type="hidden" name="term" class="term" value="<?php echo isset($_GET['utm_term']) ? $_GET['utm_term'] : '' ;?>" /> <input type="hidden" name="medium" class="medium" value="<?php echo isset($_GET['utm_medium']) ? $_GET['utm_medium'] : '' ;?>" /> <input type="hidden" name="content" class="content" value="<?php echo isset($_GET['utm_content']) ? $_GET['utm_content'] : '' ;?>" /> <input type="hidden" name="campaign" class="campaign" value="<?php echo isset($_GET['utm_term']) ? $_GET['utm_term'] : '' ;?>" /> <div><button></button></div> </form> |
This form you should not stupidly copy and correct for your site settings.
call.php - The processor of our form and where the client gets after pressing the send button (it's also with the page of the successful sending).
fio - Surname Name and Patronymic (must be the same as in the handler do not change these values)
phone - Well here it's clear that this value should not be changed either.
referer - Will tell us the address from where the user came to your site
price - Price of the item
goodID - ID goods from the CRM system, must correspond to the added goods in the system itself.
source, term, medium, content, campaign - Tags for links
Well, as if with the form and everything, now proceed to the handler itself call.php
2 - API Code Handler:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
<?php if ($_POST['fio'] && $_POST['phone']) { $curl = curl_init(); //session initialization curl_setopt($curl, CURLOPT_URL, 'https://login.leadvertex.ru/api/admin/addOrder.html?token=token'); //url site to which we address //curl_setopt($curl, CURLOPT_HEADER, 1); //output titles curl_setopt($curl, CURLOPT_POST, 1); //POST data transfer curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //now curl will return the answer to us, and not output $postData = array ( 'fio'=>$_POST['fio'], //Full name 'utm_source' => $_POST['source'], //first label 'utm_term' => $_POST['term'], //second label 'utm_medium' => $_POST['medium'], //third label 'utm_content' => $_POST['content'], //Fourth label 'utm_campaign' => $_POST['campaign'], //Fifth Label 'phone'=>$_POST['phone'], //Phone 'quantity '=>'1', //Quantity 'domain'=> $_SERVER['HTTP_REFERER'], //Domain from where the order was received 'ip' => $_SERVER[REMOTE_ADDR], //IP Address 'referer' => $_POST['referer'],//Referer (where the visitor came from) 'price'=> $_POST['price'], //Price of goods 'goods' => [ //Product Details 0 => [ 'goodID' => $_POST['goodID'], //ID 'quantity' => 1, //Quantity 'price' => $_POST['price'] //Price ] ], 'searchButton'=>'get' //this is in case the site on which we are checking is checked whether the submit button was pressed, and whether the form ); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt($curl, CURLOPT_USERAGENT, 'MSIE 5'); //this line seems to say: "I'm not a script, Ρ IE5" :) curl_setopt ($curl, CURLOPT_REFERER, $_SERVER["HTTP_REFERER"]); //and suddenly there check the presence of a referee $res = curl_exec($curl); //echo $res; /* //if an error is typed, the number and message if($res) echo 'Thank you! Those. we understand that everything is ok'; //Before this, of course, it can be handled by any str_replace, etc. */ } curl_close($curl); ?> |
Here I commented on each line on this I think there will be no problems with this code.
What to do with this code? Yes, everything is simple, you need to create a file handler, in this case call.php and put this code in it.
Do not forget to change the login and the token in the call line.
With a handler all.
The third point, as you already remember from the beginning of the article, I wrote that we will use both the handler and the successful order page in the same file, so we need to add the text of the notice of a successful application or order.
3 - Successful order page:
In the same file call.php below the call code, we insert such a simple code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//RU" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Congratulations! Your order is accepted!</title> <meta name="generator"> <?php header( 'Refresh: 5; url=/' ); ?> <link type="text/css" rel="stylesheet" href="media/css/style000.css"/> <div class="wrap_block_success"> <center><img class="susses" src="media/images/crm_ok.png"></center> <div class="block_success"> <h2>Congratulations! Your order is accepted!</h2> <p class="success">In the near future an operator will contact you to confirm the order. Please include your contact phone number.</p> </div> </div> <div id="send-line-s"> </div> <style type="text/css"> #send-line-s {background:#017dc0;min-height:53px;color:#fff;padding:10px 0 0 0;position:fixed;width:100%;bottom:0;text-align:center;} #send-line-s .text {line-height:22px;display:inline-block;text-align:right;vertical-align:middle;padding:0 15px 0 0;} #send-line-s input[type="text"] {background: #FFF;border:1px solid #10628E;width:260px;height:35px;padding:0 13px;display:inline-block;vertical-align:middle;} #send-line-s input[type="submit"] {background: #FFC107;border: 1px solid #FF9800;color: rgba(0, 0, 0, 0.8); font-size: 16px; font-weight: bold;width:119px;height:35px;line-height:35px;display:inline-block;vertical-align:middle;text-align:center;margin:0 0 0 11px;cursor: pointer;} #send-line-s input[type="submit"]:hover {background: #EAB208;} #thankyou {font-size: 24px; color: #ffffff;} </style> </head> </body> </html> |
As you can see there is nothing complicated in this, this code will show your client what kind of text in this case, congratulation, and redirects in 5 seconds of the user back to the page.
Yes, and yet this code, we slightly processed CSS styles and added a picture to it, you can download a CSS file and a picture below the post.
Well, like everything, now you can transfer all your orders to this CRM systemΒ for further processing.
CSS files as promised I'm attaching here.
Use your health, you will write questions.
No Comment
You can post first response comment.