Prevent link change after click (third party plugin is altering my link) - javascript

I'm using a map embed software and have embedded the code in to my WP site (elementor pro). I'm having an issue with the link url changing on click, I'm sure it has something to do with their software. Here's the best I can explain it:
I want users to be able to click the "directions" button that loads under the map marker, and have it open on apple maps because they will redirect to google maps if user is not on iOS device - google maps links have no such function from what I can tell. This service (storepoint), by default opens everything in google maps.
I figured it would be an easy fix and I updated my "address" in the storepoint software to be -- http://maps.apple.com/?daddr=6619+West+Cross+Creek+Bend+Lane,+Fulshear+Tx -- and it seemed to have worked (in their software it correctly pinned that location on the preview map), however when I refreshed my website the button link showed up as https://www.google.com/maps/dir//%3Ca%20href%3D%22javascript%3A%3B%22%3Ehttp%3A%2F%2Fmaps.apple.com%2F%3Fdaddr%3D6619%2BWest%2BCross%2BCreek%2BBend%2BLane%2C%2BFulshear%2BTx%3C%2Fa%3E -- so basically they just added the google maps url infront of my apple maps url rendering both map links completely useless.
Somehow my link is magically changing. I'm wondering if I can use the button id and do something with JS to prevent this. I have no idea though.
If anyone comprehends my rambling and has a work around I would appreciate it.

Related

clarity.js by Microsoft slowing overall page loads

I have a customer using bing tracking via https://bat.bing.com/bat.js.
On December, 6th 2021 it started calling in clarity.js without the customer making any changes to their code.
This slowed the overall page load by 1 second on mobile and 500ms on desktop. I've been trying to figure out how to disable this JS but I'm not sure what to do as it's being fired from the bing tracking js.
The bing tracking code is being triggered via google tag manager.
Anyone else having this issue and know how to disable clarity.js from being called at all?
Customer is using Wordpress. Amazing Bing can implement code that slows down a site overall page speed without any notification to the customer.
This seems to be added mid-November 2021. Problematic for sure, as it broke our website in certain situations. To disable it, follow these steps:
Go to ui.ads.microsoft.com
In the top bar go to Tools, then under Conversion tracking click on UET tag
In the table at the bottom of the page click on the name of your tag.
Under Enable Microsoft Clarity disable the checkbox and click the Save button.
This should directly remove the script from your website.
I've found the way to turn off Clarity. In Microsoft Advertising, the UET tag has to be re-configured. A checkbox appeared in the UET wizard that allows you to turn off Clarity.
We figured this out by going into our bing web tools and disabling the Clarity integration.

Google Analytics propagate source

I am using Google tag Manager and Google Analytics.
I have a link on my yelp page like example.com/?utm_source=Yelp.
What I want is to be able to track that source even if the user clicks on a different link on my website, say to example.com/new-article.
So if a user fills out a form on that page, I know the user came from Yelp.
Summary:
A customer goes from Yelp to example.com then clicks another link. How can I still know that the user came from Yelp?
One strategy is I can append utm_source=$_GET['utm_source'] on all links on my page, but I assume google analytics or google tag manager has already solved that problem. I'm having trouble finding information on this.
Source is a session-level dimension, so if a user comes to your site with a utm_source param in the URL, that source dimension will be applied to all hits (pageviews, events, etc.) in the session.
In other words, you don't need to do anything special to make this work.

Javascript onclick method in ArcGIS iframe is disappearing

I'm using ESRI's ArcGIS Web App to create a map that has several interactive features. By clicking on specific objects in my map, users will see a pop up (created using the Web App creation features) with information about the area they clicked on.
Some of those pop ups contain a link that should open up a new window to display an image (that I have hosted on my web server).
Here's where my problem begins. In the map builder, inside my ArcGIS online login where I set everything up, I have added the link control to the configured popups that tells it to use Javascript in an "onclick" to tell it to open a new window, of a specific size, and where to find the image to display. It all works fine in the builder. But as soon as I create the web app, it completely drops my "onclick".
And more-so, I tried to work around this by changing the href of the link to "javascript:myScriptHereTellingItToOpenANewWindow" and the web app then drops the "javascript:" part and changes it to "#" thus still not working when I click it, all it does is try to open a new browser tab and ignores the rest of the script written in the href.
I'm sorry I have to be somewhat vague because this is for a company project that has high security. Below is what little code I can share (cleaned up a little to hide confidential information).
In the ArcGIS Web Map builder, here is the code I have in my configured popup:
<a onclick="window.open('URL of image file I want to load','width=1000,height=202,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no,resizable=yes');" style="cursor:pointer;" target="_parent">View Featured Line</a>
And as I said, that works fine in the editor. But once I chose to "Create a Web App from this map" it drops the "onclick" completely.
If I put it in the href tag, like below:
View Featured Line
Then when I "inspect source" in the web app, it looks like this (which doesn't work either):
View Featured Line

Google Indexing and Redirects

I have a site (I can't provide a link to it), where we're using links to generate lightboxes that have iframes to content.
We're linking to the content like so:
<a href='/path/to/lightbox.php' onclick='generateLightbox("/path/to/lightbox.php")'>link</a>
On the page, we're using the following to forward to the main page and open up a lightbox if a user tries to access the lightbox content directly:
<script>window.location="index.php?openLightbox=/path/to/lightbox.php"</script>
Our problem is that google is not indexing these lightbox pages. While going through the webmaster tools, it's giving a warning that a "redirect" is detected.
Is there anyway I can make sure to redirect users to the main page and open up a lightbox without tripping up google's quality checker? I believe my problem is that google is seeing the redirect and not indexing the content, yet I'm using the method I've seen suggested on a couple different resources such as this SO question: Redirects & Google Indexing
In the end, the only solution we could find was to detect for google bot, and not redirect.

How to show images in local google maps?

I want to show photos in google maps, my project looks like this:
/index.html
/photos/1.jpg
/photos/2.jpg
/photos/.....
index.html is embedded with a google maps, like this:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=places"></script>
<div id="map"></div>
So when I open index.html in local browser, a google map would be displayed. Then I want to show photos/*.jpg on the map. How can do that?
Is there some libs help me to do that? I searched github but cannot found one.
I am not sure I completely understand the question, but if I do, then you need to do this on Google's end. Not yours. What you do, is you go to https://mapsengine.google.com/map/ and set it up how you need to. You can set it up by typing in the address of the location you want (or drop a pin) and then click on that pin. You can then choose to "Add to Map" and it saves that location. Once you have all the locations you want, you can edit them by clicking the little paint bucket icon that appears when you scroll over the locations. Unfortunately, you can only use Your icons in the Pro version which will cost you. If you want, you can then import the map with an iframe by clicking share in the upper right hand side of the screen. Set 'Who has access' to Public, and copy the link. Paste that link into an <iframe> and then change the word edit to embed. Your result should look like this <iframe src="https://mapsengine.google.com/map/embed?mid=zT7J1AkkmHFM.kQCUyqfvFqZA"></iframe> set the iframe to the way you need it to be, and you are good to go.

Categories