How did gdprscript.js get into the header of my Weebly site? - html

When I view the source of my website, I am seeing this script inserted into my website. However I cannot find the template where it is being added.

This javascript html tag is inserted automatically by Weebly's backend server itself. It inserts it immediatly after the <head> element and before any items you have defined in your actual template file.
<script src="/gdpr/gdprscript.js?buildTime=1558379751&hasRemindMe=true&stealth=false"></script>
What does it do?
This code forces the display of the "This site uses cookies..." message that pops over the bottom part of the page. It also handles the user's selection.
Why is it inserted if my site does not use cookies?
It is inserted because Weebly itself forces your site to use cookies. It does this to enable its own collection of analytics on your homepage.
Does it slow down my site
Yes. Code like this should be inserted after the site content.
Can it be removed?
You may be able have this removed by contacting Weebly directly.

Related

Google Tag Manager fires tags in preview/debug, but not on the live site

I've used GTM numerous times to fire LD-JSON business schema via a custom-html tag with Tag Manager. This time however, I'm running into issues.
The tags fire in the debug/preview mode of GTM, but when I publish it they are not found on the live site. Tag assistant shows no issues with the installation; I should add the custom HTML doesn't appear on the debug/preview, but the tag does fire (per the debugger).
The site in question uses WP-engine, but I've been told that's not likely the issue. If anyone can point me in a direction that would be great.
I posted on the product forums for google: https://productforums.google.com/forum/?utm_medium=email&utm_source=footer#!msg/tag-manager/RfxZcqbWrSg/wAWzn98TCwAJ
The issue here was GTM was using the 'document.write' feature for the custom HTML container (which housed the LD-JSON Schema). Removing that feature populated the site where Google could read the schema.
Props to Simo for being a 'sweet dude' for pointing this out.
I also faced one similar issue, and for me it was how google tag manager file was served from the app.
It was being served as
https://www.googletagmanager.com/gtag/.js?id=yourGtmId
instead of
https://www.googletagmanager.com/gtm.js?id=yourGtmId
Although in the preview mode, the correct file was being served somehow!
Just want to mention that I was having this problem also, and being new to adding custom HTML / JavaScript to my website through Google Tag Manager, I was completely oblivious to the fact that you must click the submit button in the top right of one of the main views (Overview, Tags, Triggers, etc.) in order to publish your changes. I was thinking that the save button within the trigger or tag was all that was needed.(Be sure that you are not forgetting this simple step!).

Serve up different HTML pages from same script?

I am trying to have a single GAS project that changes its UI by serving up different HTML pages based on what the user clicks. I cannot figure out how to serve up different HTML from the script, replace the current browser page and retain state. Any help appreciated. Thank you.
I use two options:
Have a main page which has buttons or text areas with onchange set to a function which calls back to the server side and gets new page data, then replace the current page or a portion of the page, with the new page.
Pass parameters in the URL and have the server side doGet() parse the parameters and branch to load a given page based on these values.
I have used a combination of both of these effectively. Basically I have a div which has my "menu" and a div which is the section to be replaced. My menu changes and then data is sent back to the server to get the dynamic body. The HTML is returned and then I replace using innerHTML.
In the same code I offer the ability to pass menu values via the published URL. This allows me to go directly to some values if I so choose as I have a Google Site where we embed the script into pages and the menu selections may be specific to that page. It allows us to use an iFrame to show the web app and go directly to the pertinent interface.
With google.script.run you can run any script on the server from the html page. By communicating with the server you have access to PropertiesService which gives you the capability to store information between pages. Personally I like the HTML Service createHtmlOutput(html) because I can edit the html without having to edit a separate page.
I decided to answer your question here so that I could use the code section.
Question:
I am actually looking to avoid manipulating the HTML and serve up a
completely different HTML file stored in the project. How do I make
the page call the script again and replace itself with the new
content?
We I'm guessing that completely replacing the page is not really what you want because the user will suffer a page refresh. But you could create divs like this:
<style>#R01{display:none;}</style>
<div class="replaceable" id="R01"></div>
If you put all your replaceable content in divs like that then you can request content from the server via calls like this:
google.script.run
.withSuccessHandler(updateConversation)
.withFailureHandler(showStatus)
.getConversation();
and put the new content into the appropriate divs and then change the css with another pair and turn the old content off and the new content on. Thereby avoiding a page refresh. Don't forget to save the old data into the PropertiesService first. So I don't think changing the entire page is the way to go but I could be wrong. I think just changing some of the internal content will avoid the need for a total page refresh. If you want to change images you can avoid another download by using CSS Sprites

Change icon based on posts from another page

Apologies if this has been asked before. I searched and couldn't find anything.
I have a basic landing page website that has an icon that links to "Hot Alerts", ie notifications of system outages. What I'm wondering is if there's a way to either change the icon or add a notification bubble (similar to Facebook notifications) if content on a Sharepoint blog has been updated in the past "X" hours.
Here's the icon I'm referring to:
Hot Alerts Icon
I've found examples of how to style the icon with CSS, but those all require manually entering the number of new notifications.
What I need is a way for the icon to "check" the sharepoint page for its most recent post when the landing page is loaded.
Most of my colleagues use Internet Explorer, but Chrome is creeping into the workflow.
What you need to use it the Javascript Object Model (JSOM). You will be able to read lists (for new posts) upon page loading and then showing or hiding the icon. A lot of example code to read lists can be found on SO.
If you want to use a 'bubble', take a look at sp.ui.notify (https://msdn.microsoft.com/en-us/library/office/ee550701%28v=office.14%29.aspx) methods to show an overlay notification popup on the page.
It's very unlikely this can be done with pure CSS. Any of the following languages will provide suitable solutions: JQuery, JS, PHP.
In PHP, you could use $_GET to place the variable in the URL. So one page would use $_GET to post the variable to the URL and the PHP file loading the page would use it to retrieve the variable from the URL.

mailchimp signup form leads to 404

I have a mailchip signup form in the footer of my site. I've noticed recently that after trying to signup, the user is greeted with a 404:page not found error reading:
MailChimp It seems the page you were looking for has disappeared We’ve
recorded this vanishing act and our team of chimp magicians will find
the missing link.
The form worked perfectly on my old site, I'm not quite sure why it's suddenly stopped- I didn't change anything but the styling.
When you create your MailChimp subscribe form, you have the option to specify your own Thank You page that users are sent to after they subscribe:
http://kb.mailchimp.com/article/can-i-design-and-host-my-own-thank-you-pages-instead-of-using-mailchimps/
Are you sure that MailChimp isn't trying to redirect your users back to a Thank You page of your own... that no longer exists on your end?
Regardless, I'd recommend going through the steps on that page to create a new subscribe form from scratch, specify the options including the Thank You page that you want to use, and place the new embed code in the footer of your website. That should fix whatever is currently broken.
your question is broad,It may have multiple reasons:
1: Compare your old code and new code and see difference if any malicious code is written (includes other pages or script that leads to errors)
2: Check if the Signup page (abc.html etc) file is present on the server and not deleted/Renamed during deployment. Also check nested pages that are included as headers/ footers
3: Some times files are placed in the wrong directory. Make sure particular file is placed at the required location.
please specify what type of page is it and called from which source (JSP/simple html etc).

How can I get a chrome extension to affect the webpage itself? (not the popup)

I have been reading the dev guide but haven't been able to work out how to put my own codes into webpages
I know it is possible because AVG uses it (in it's link scanner), and FastestChrome extension uses it too (highlight something and a link to a search pops up).
I have a backgrounded page but I can't get it to effect the webpages I go on (permissions are correct as I can get css to effect)
I am probably missing something really simple :/
It's not intuitively presented in the documentation but your background page can not access the current webpage b/c they are in different contexts. In other words the background page is it's own separate page so it has no access to any other page's DOM.
If you want to affect the page the user is viewing in the browser you will need to use what is referred to as a "content script".
If you want to communicate between content scripts and the background page you will need to refer to the message passing API. Check out my extension's source code for reference. I do exactly that.
Just remember...
Background Page: used for general logic in your extension, not anything page specific.
Content Scripts: are loaded into every page the user sees, and can manipulate that specific page.
Those probably use Content Scripts to inject Javascript into webpages. These scripts run in the context of the web pages and can access the DOM.
You can either define a script to always run in a web page by declaring the script file in the extension manifest, or you can use your background page to inject a script when needed.