-
AuthorPosts
-
July 5, 2023 at 6:20 pm #1412532
Hi folks,
at first: thanks for the awesome theme. I am using it for different projects and I like it so much.
My problem: I try to paste a script from immowelt.de into my enfold website that shows a list of real estate property and loads this information directly from immowelt.
In Gemany we need to implement an embed privacy function bacause of the privacy policy, so that the script is only running after the visitor allowed it like for YT videos or twitter posts etc.
The script works fine but when I try to put in behind an embed privacy button it doesn’t load the whole script. I also tried to put it in a normal text field and inside the code block element of enfold.So I tried two ways but both didn’t work.
Method 1) is the plugin “Embed privacy”. If it’s installed and activated it doesn’t do anything. The script already starts directly and there is no “hiding” or button for allowance even if I create an individual embed for this
Method 2) is a custom script from https://www.altmann.de/blog/code-snippet-shortcode-zustimmung-fuer-externe-inhalte/. It works with the allowance field and button but when you hit the button it loads only the link of immowelt and not the whole script with list, pictures etc. when I put it into the [ma-content-consent] tags.The immowelt script is:
<div id='iwModule'><script language='javascript' type='text/javascript'> var guid = 'e6b542a2cdd64f518b77f7ade56d8d76'; </script><script language='javascript' type='text/javascript' src='https://homepagemodul.immowelt.de/_scripts/iwag/homepagemodul/homepagemodul.pack.js' ></script><div id='iwWidget' class='iwWidget'></div><noscript>Bitte aktivieren Sie Javascript.</noscript><div id='iwdigetinfo'>powered by <a id='iwdigetinfolink1' rel='nofollow' href='https://www.immowelt.de'>immowelt GmbH</a></div></div>
Could you please help me to solve this problem? Thank you.
Greetings
Michael- This topic was modified 1 year, 5 months ago by MW-Design.
July 6, 2023 at 2:32 am #1412576Hey MW-Design,
Thanks for your question I tried your immowelt script on my test site but it only shows a link and the message Request incorrect No valid data available will this only work on your domain?
I tried the Approval for external content snippet and this seems to work correctly.
Please check your immowelt code above if it should work on any site, if it will only work on your domain please include an admin login in the Private Content area so we can test on your site. Try setting up a test page with the immowelt code in a code block element working so we can examine.Best regards,
MikeJuly 6, 2023 at 9:53 am #1412596Hey Mike,
thank you for your quick answer. The script only works with my domain I think. To get the code from immowelt I have to enter my domain there.
So I send you the admin login in the Private Content area.
The element is on the “Objekte”-page. There you can find it inside a code block and a copy of it inside “[ma-content-consent]-tags”.
Could you please have a look?Best regards,
MichaelJuly 7, 2023 at 2:00 am #1412646Hi,
Thank you for the login, I believe the issue was that your immowelt script is designed to run on page load but the page has finished loading when you click the content-consent button.
So I added this script to your snippets plugin so the script would run again when you click the content-consent button,function custom_script() { ?> <script language='javascript' type='text/javascript'> var guid = 'e6b542a2cdd64f518b77f7ade56d8d76'; </script> <script language='javascript' type='text/javascript' src='https://homepagemodul.immowelt.de/_scripts/iwag/homepagemodul/homepagemodul.pack.js' ></script> <script> (function($){ $("[id^=ma-content-consent]").click(function(){ $.getScript("https://homepagemodul.immowelt.de/_scripts/iwag/homepagemodul/homepagemodul.pack.js"); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
I see that you don’t have a SSL for your site yet so it loads as http and the script is calling https, typically this would cause “mixed-content” issues, I didn’t see this but my browser kept giving me warnings, I would recommend enabling SSL.
Best regards,
MikeJuly 7, 2023 at 2:08 pm #1412694Hi Mike,
thanks for your help. It works perfect. I’ve got one problem left: The immowelt script loads cookies directly if you visit the website (any page, not only on the “Objekte”-page) without permission.
How can I integrate them correctly in the cookie privacy modal of enfold?
I tried to add theme separatly as custom cookies with their names which the developer tools of my browser shows me but that seems not to work because there are no paths for the cookies shown in the developer tools.
Is there a way to combine all the cookies to a category named “immowelt” for the modal with one check box?PS.: The SSL should be configurated in a few days.
Thanks a lot and have a nice weekend.
Regards,
Michael- This reply was modified 1 year, 5 months ago by MW-Design.
July 7, 2023 at 5:46 pm #1412704Hi,
Glad to hear this helped, but if you are using the content-consent script shouldn’t clicking this button also give consent for the cookie? The content-consent script allows you to change the message to state this. The way that the immowelt content is loaded is like a iframe so you can’t control the content or it’s cookies.
As I understand this is the reason for the content-consent script, to notify and allow for the third party cookies, and if they click the button and then go to another page they have already given consent.Best regards,
MikeJuly 7, 2023 at 10:05 pm #1412712Hi Mike,
you’re right, clicking the loading-button for the immowelt script should allow the cookies but now the cookies are loading directly by visiting the website and not only if you click the button to load the script. Chrome shows the cookies in the developer console as active even if the script is “locked” behind the consent button.
Do you have a tip or solution for this?Thanks for your held and time. :)
Regards,
MichaelJuly 8, 2023 at 12:34 am #1412717Hi,
It looks like the homepagemodul.pack.js file is calling the cookies even before the other part of the script that creates the element is run.
My script above called the js file so it could be run on button click, otherwise it would not work just as you had experienced.
So for a couple of options,
1: ask the immowelt team if there is a “no cookie” version of this file, like how YouTube has a “no cookie” version of their embed script.
2: disable my script and show the immowelt team the script in the content-consent shortcode and ask them if there is a function you can use to run the immowelt script, I would imagine there is I just don’t know their code and they would.
3: add the immowelt script to a different page or html file that would not have direct access, and then load it via a iframe within the content-consent shortcode, the content-consent page showed an example with an iframe.Best regards,
MikeJuly 8, 2023 at 2:05 pm #1412724Hi,
thanks for your tips. I tried the 3rd method to integrate the script into an iframe within the [ma-content-consent]-tags but that doesn’t helped. The cookies are already loading if the visitor enters the website.
I already sent a mail to the immowelt-support and I am waiting for their answer. I asked for a “no cookie”-version and for a method to integrate their script privacy policy friendly. If they send me a solution I will post it here.If someone here got any other tips or solutions I am glad to hear them.
Thanks everyone. :)Best regards,
MichaelJuly 8, 2023 at 2:21 pm #1412726Hi,
When you test the 3rd method please disable the script that I added it should not be needed and should stop the cookie from being loaded.Best regards,
MikeJuly 8, 2023 at 3:17 pm #1412729Hi Mike,
thanks for your detailed help. :) I disabled your script an now the cookies only load on click.
If immowelt sends me another solution without an iframe or something I will post it here.Greetings,
MichaelJuly 8, 2023 at 3:44 pm #1412731 -
AuthorPosts
- You must be logged in to reply to this topic.