Jump to content

Marco Ro

  • Posts

  • Joined

  • Last visited

Everything posted by Marco Ro

  1. Thanks for your hard work, I can only imagine how complex it is to build a system like this.
  2. Hi there, the idea of this module was born from the need to integrate FB API to bypass the block of reading data after the IOS14 update. FB tells us that in order to continue reading the data we have to send it via the API Convention. I wanted to publish this module finished, but I can't figure out how to do this. :( I don't know if anyone is willing to help me understand how to solve my problems. I'm trying to create a module with the Facebook SDK to send info via API. I attach here what I have done, at the moment, it is all very simple and rough. facebookSDK.zip At the moment the module works only as a link to the SDK folder and can be used to enter the credentials of the token and pixal via two variables. What I would like to do is to leave all the request to the SDK, in order to keep only the creation of objects in the page. Since the use cases are so many, I thought the best solution is to delegate to the module the connection with the SDK and keep in the page the creation of objects to be customized. Basically for the Convention API you need to make these objects UserData CustomData Event For let this module works fine, at moment, I have to add in to the page also the call to the SDK. So, in my page I have $fbSDK = $modules->get('facebookSDK'); use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; use FacebookAds\Object\ServerSide\Content; use FacebookAds\Object\ServerSide\CustomData; use FacebookAds\Object\ServerSide\DeliveryCategory; use FacebookAds\Object\ServerSide\Event; use FacebookAds\Object\ServerSide\EventRequest; use FacebookAds\Object\ServerSide\Gender; use FacebookAds\Object\ServerSide\UserData; // Configuration this all $time = time(); if (isset($_COOKIE['_fbc'])) {$fb_fbc = $_COOKIE['_fbc'];} // This data is always better to have if (isset($_COOKIE['_fbp'])) {$fb_fbp = $_COOKIE['_fbp'];} // This data is always better to have $access_token = $fbSDK->accessToken(); $pixel_id = $fbSDK->pixelId(); // Initialize Api::init(null, null, $access_token); $api = Api::instance(); $api->setLogger(new CurlLogger()); $events = array(); // Specific data only if need in the object $hashEmail = hash('sha256', $user->email); // some data need to be hashed with SHA256 and UTF-8 encoding $user_data_0 = (new UserData()) ->setEmail($hashEmail) ->setClientIpAddress($_SERVER['REMOTE_ADDR']) ->setClientUserAgent($_SERVER['HTTP_USER_AGENT']) ->setFbc($fb_fbc) ->setFbp($fb_fbp); $custom_data_0 = (new CustomData()) // all these data are optional, I only include them as an example ->setValue(str_replace(",", ".", $page->pad_price)) ->setCurrency("EUR") ->setContentName("API test") ->setContentIds($skuAPI_json) ->setContentType("product_group") ->setCustomProperties(array("product_catalog_id" => "111111111")); $event_0 = (new Event()) ->setEventName("ViewContent") ->setEventTime($time) ->setUserData($user_data_0) ->setCustomData($custom_data_0) ->setActionSource("website") ->setEventSourceUrl($page->url(true)); array_push($events, $event_0); $request = (new EventRequest($pixel_id)) ->setEvents($events); $request->execute(); I would like to bring all this part into the module: use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; use FacebookAds\Object\ServerSide\Content; use FacebookAds\Object\ServerSide\CustomData; use FacebookAds\Object\ServerSide\DeliveryCategory; use FacebookAds\Object\ServerSide\Event; use FacebookAds\Object\ServerSide\EventRequest; use FacebookAds\Object\ServerSide\Gender; use FacebookAds\Object\ServerSide\UserData; // Configuration. if (isset($_COOKIE['_fbc'])) {$fb_fbc = $_COOKIE['_fbc'];} if (isset($_COOKIE['_fbp'])) {$fb_fbp = $_COOKIE['_fbp'];} $access_token = $fbSDK->accessToken(); $pixel_id = $fbSDK->pixelId(); // Initialize Api::init(null, null, $access_token); $api = Api::instance(); $api->setLogger(new CurlLogger()); While keeping everything else on the page, so that it is customizable according to the needs of the moment.
  3. Hi @Marvin, could I ask you if please share the function? I am trying to do a similar thing, but I am stuck at this point!
  4. Hi, after the update from the 3.0.123 to the 3.0.164 I have some problem: The website start to be really slow and the server often go in times out with error 500. The different in performance was about 5/6s of TTFB. I try a lot of different things to recover speed and no longer have the error. In the end we went back to the previous version and everything worked better. On the 3.0.164 version I notice this error that maybe they can help to understand the reason for the problem with the update: Analyzing the site with the help of the server provider we found that: the index page make a lot of executions, was 38737 in 1 day. This is to very much for the traffic that we have, in the same day our IP is run 23206 call, that look impossible. I'm not sure the problem is about those things, I also the server use nginx, maybe could be this. At moment we will keep using the 3.0.123 version, but I would like to make the upgrade to use the new API. Someone can help me to understand why the site has become slow? UPDATE I tried to load version 3.0.148, but still I notice a slowdown of the site. The TTFB grow from 2.8 to 6.3 Someone know if there is a way to use the webp format for version 3.0.123 as well?
  5. Me too was looking to Digital Ocean's, is so interesting service. But I didn't experience and It seems a bit complex to use. I did not know Hetzner's, it is very interesting the MX93-HDD plan would be what we need even if it is a bit more expensive than what we pay now which is 79€ Thank you so much, I will take them into consideration.
  6. Yes sure @netcarver, managed possible with include not less than 4CPU and 8G Ram, and that can carry a heavy load of PHP processes. Our site is a bit heavy I'm trying to move some client side processes and also changing the markup by putting less php rendering and more html, but the website still heavy.I just add proCache but on some pages the server response times remain long. Thank you @rick, I know ovh. I only used it once, it seems like a good service, but I did have problems with customer support and one time the server broken down bad for hours. I built this site on it: medipet.it, it is a Processwire + Padloaper. It's over a year old and I don't think it has ever had any maintenance, but it still good.
  7. Hi everyone, Do you have a Hosting that uses Apache in Europe to recommend? At the moment I'm using Sitegroud the Cloud hosting version 3CPU 4G di RAM, but I don't like it, they have made updates and it always gives me problems. Also, they use NGINX and I seem to understand that it doesn't combine well with Processwire
  8. @PWaddict I know not everyone has this problem. Me too for a long time all works without problems, but after I get this error the only thing that worked was to disable css
  9. Hi, maybe it can be useful to someone. I had a problem with the sitemap generated because Google, or a check tools, tell me that the page was an HTML code. And if I inspect the page it is actually encoded as an html page. Inside the backend setting I have decheck the checkbox about the CSS, the one ask "Add a stylesheet to the sitemap". And this fix the problem. Now the page are render correctly. With tags: url, loc, xhtmal, image and so on... Now works so well!
  10. Hi @nbcommunication, I like a lot your project and thank you for sharing your experience. Could I ask you few questions? I really like your map, I haven't been able to figure out what you used to create the map! what did you use? Why you use Google Analytics and also Matomo? Shouldn't Matomo replace what analytics does? Thanks!
  11. Really an impressive job! Except that in this preview I have already seen everything an e-commerce needs, and even more. Can't wait to see how the APIs work!! This year we already had in mind to redo the site, it could be the kick in the ass we needed!
  12. Hi, There is a way to use an antispam system instead of using the opt-in or reCAPTCHA ?
  13. Hi @daniels, Yes, the subscribe method works very well. I have just tried and all the fields are correctly updated. Thank you for your module, this really speeds up my work.
  14. Hi, I have not clear how to update a user information. Is it possible? Ok super easy! Just use $subscriber method! Wow thank you, this really speeds up my work!
  15. Hi @Mike Rockett, First thank you for your modulo. I notice this error on the Search Console: The sitemap can be read, but it has errors. The sitemap is in HTML format It appears that your sitemap is an HTML page. Use a supported sitemap format. Examples Row 1 Tag: html At the moment it doesn't load me any links in the search console. What can I do?
  16. Thank you @Robin S, now work well. Thanks 🙂 I copy here some part of the documentation, if someone need:
  17. Hi everybody, I have to change the price of some products based on the type of role the user has, if he is logged in. For do this I use a module, I can change the price based of any fields in the products page but when I try to access to $user data give me an error, like this: isLoggedin() on a non-object or if I use $user->hasRole I give the same error hasRole on a non-object. I think the problem is that the module can't know which user is logged in, but I can't find a solution. Can someone help me to understand how I can access to this data to change the price? Thank you
  18. This is an amazing project! I tried it works pretty much everything. I really hope that someone with the right knowledge (and here there are many people who have them) can complete and implement it. Anyway I start using it right now! Really thank you @joshuag for this module!
  19. Hi @Robin S and @dragan, sorry fro the late reply. Ok thank you! It's very nice, I can also use $defaultClasses to add class and not use jquery. About the css I find a solution and the result is very beautiful. Thank you so much.
  20. Hi @dragan thank you, yes I need this for make a re-style of css, I use the field in the module LoginRegister and Padloper, all of these render directly the Inputfield. I can't find a solution only with the css, I need to move the tag label because it has to work inside the InputfieldContent. I need move the text label inside the input, when write inside the input the label text will be smaller and move across the InputfieldContent box. I try to use the appendTo(), but without using a unique ID or class it doesn't work well. I also try to use the placeholder attribute, but doesn't work like we would like. I never use the FormBuilder module, I read that is very nice module and sure I can make every contact form that I need, included the login form, but in this way I have also to write all the system for the login form like the registration, the forget password etc.. Also I probably I can't use FormBuilder with Padloper module. There are no way to move the label inside the InputfieldContent?
  21. Thank you @ottogal, yes this could be a solution, but I have make one like of code for every input. I will like have this render for all the input. For this reason I was thinking of a hook solution on Inputfield.
  22. Hi, I need to change the position of the label tag. In all render the input field look like this: <div class="Inputfield" id=""> <label class="InputfieldHeader" for="...">Email</label> <div class="InputfieldContent"> <input id="..." name="..." class="..." type="" maxlength="512" autocomplete="off"> </div> </div> I would like move the label tag inside the InputfieldContent after the input tag. I try to work around the render hook, but didn't found a solution, and also I'm not sure is this the way. How can I do it? Thank you.
  23. Many thanks @BitPoet, it was the right kick that was needed! I understand that I should be able to do everything I need to do! I just have to do it 😅 (but if all works well could be the funny part of the job!)
  24. Thank you @dragan. Absolutely yes, you're right I immediately create a copy of the theme and I'm going to work on that. In AdminThemeDefault I just see this part that render all content, but I don't have understood where the pages are. <?php $body = $page->get('body'); if($body) echo $body; unset($body); echo $content; echo $extras['content']; ?> This theme will only be a version associated with a specific user, the Editor. It would be really brilliant if I could change the content that is rendered in this part working like in the front-end. I check the AdminThemeDefaultHelpers and I find something, but not look like all data are in this page, or am I wrong?
  25. Hi guys, I'm would like to customizing the admin page to make it very simple for a customer. But I can't find where I can edit some part of the page. These are the parts I can't find: I would like to position the edit button differently and customize the row, like add a imagine before the title of the page. I would like edit the table by add photo and others info I would also like to be able to add a specific page in the left menu that shows me on the right the children of that page. Example: under the heading pages add Blog and in the left pages the list of articles. At the moment I have seen that inside wire/modules/AdminTheme/AdminThemeDefault I can modify the general page but I don't know where to take the other elements. Can tell me please if it is possible to do this and on which pages can I go to work? Thank you so much!
  • Create New...