Social Media Plugins and Cookies Notification

Posted by Kevin Tran on 2020-04-22

Two Days Today

I figured I didn't need to make an update every single day and could make these every other day. Yesterday was a pretty nice day, the plugin for Facebook was super simple to implement, I did need some help from my lead engineer to implement the plugin for linkedin since the documentation for that was not great. I was really close I just needed to include one of the script tags in the component where it needed to be rendered. Once I got both of them rendered I tested the few different layouts that linkedin and facebook provide to us and sent the screenshots to my lead engineer so we could decide what looked the best. He let me make the final decsion.

Today I worked on implementing the new cookies notice. We are using the Klaro project to manage the cookies on our site now. The doumentation is pretty straight forward, but there were some things that I didn't think about but my lead engineer helped me think through them and resolve the issues.

The issues were that I thought that copying the config.js file exactly as the example would work regardless, I did not even think about if it had to be setup properly as through the research I did others had success just copying the sample config.js file. But after we went through some of the set up it started working, kind of. The files were not being found, because the site uses gatsby we had to include those files in the static folder so that they would be able to be found with how gatsby compiles. Once that happened we got the modal for accepting the cookies to show up.

The next issue was that it is pre styled by Klaro, which is nice but it did not look good with the color scheme we have going on and the position of where the notice is would overlap with some other widgets we had. So instead of trying to restyle with classnames etc. I dove into the minified js script and changed the styling in there and got the postion and colors to match our site. It is looking pretty good now, I just have to add the other services that we have for the cookie manager and I think I will be done. That will be done tomorrow.

...back to blogs