Jump to content

Marco Ro

Members
  • Posts

    313
  • Joined

  • Last visited

1 Follower

About Marco Ro

  • Birthday 05/08/1987

Profile Information

  • Gender
    Male
  • Location
    Reggio Emilia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Marco Ro's Achievements

Sr. Member

Sr. Member (5/6)

96

Reputation

  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?
×
×
  • Create New...