Nipper Posted July 1, 2021 Posted July 1, 2021 Site URL: https://www.lngtv.com Hello, A client has provided me with a click tracker URL - https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map And I need to add this to an image, but for some reason when I hyperlink it to the image using link via web address it doesn't seem to work and when you click the image it comes up with a white screen and doesn't re-direct you. I have tested the link on the site in word form and it works fine so it's only when using it on an image there is a problem. Any reason why?
tuanphan Posted July 13, 2021 Posted July 13, 2021 Hi. Can you send track clickers url? Also, can you share link to page where you added image & track url? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Nipper Posted July 14, 2021 Author Posted July 14, 2021 Hi, Tracker URL is - https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map I added it to the animated banner at the bottom of the page, left side - https://raspberry-coyote-6gss.squarespace.com/config/pages
tuanphan Posted July 15, 2021 Posted July 15, 2021 On 7/14/2021 at 3:34 PM, Nipper said: Hi, Tracker URL is - https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map I added it to the animated banner at the bottom of the page, left side - https://raspberry-coyote-6gss.squarespace.com/config/pages Hi. I don't see tracker url. Also, /config is link for site owner. See how to find page url. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Nipper Posted July 15, 2021 Author Posted July 15, 2021 Is this URL better? https://raspberry-coyote-6gss.squarespace.com I have attached screenshots, why would it not be showing for you? URL tracker ad is: https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display
creedon Posted July 16, 2021 Posted July 16, 2021 15 hours ago, tuanphan said: Hi. I don't see tracker url. It is being blocked by ad blocker software? I had to disable mine for the page to see the images. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
creedon Posted July 16, 2021 Posted July 16, 2021 I tried to load a url as you show in your link editor image directly in the address bar of a browser window and it wouldn't load. The error was HTTP error 400 which means the sever doesn't understand the url. This indicates to me that the syntax of the URL may be bad. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=displayhttps://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=displayhref="https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display" Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 16, 2021 Author Posted July 16, 2021 7 hours ago, creedon said: I tried to load a url as you show in your link editor image directly in the address bar of a browser window and it wouldn't load. The error was HTTP error 400 which means the sever doesn't understand the url. This indicates to me that the syntax of the URL may be bad. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=displayhttps://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=displayhref="https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display" But the link works perfectly for me outside of this, if I am copy and pasting the URL directly from the client email into my browser it works. Also, if I put the URL in as text on my site this also works, so I am not sure why on an image it doesn't?
creedon Posted July 16, 2021 Posted July 16, 2021 Quote But the link works perfectly for me outside of this, if I am copy and pasting the URL directly from the client email into my browser it works. Can you post the working URL you are pasting into the image block that corresponds to the non working URL above? I'm thinking some processing is happening after you paste the working URL into the image block and it gets messed up. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 19, 2021 Author Posted July 19, 2021 This is the URL, it is the same as above - https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map I have attached images, you can see when its out of the image block it works fine, but when the same one is in the image block it gets presented with a blank screen
creedon Posted July 20, 2021 Posted July 20, 2021 This appears to be what you are entering for the image block url. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map This is what SS is producing when the page is loaded. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display Obviously SS is encoding the url, which is screwing up the link and double click doesn't like it. Other than reporting this as a bug to SS the only work around I can think of would be to use Javascript to decode the url and replace the bad url. That would require the business plan or above. Well technically you might be able to build your own image block in a code block but that would be a pain. By the way I discovered the URLs you posted but to me they are hidden. I had to dig into the source of the forum page to see them. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 20, 2021 Author Posted July 20, 2021 4 hours ago, creedon said: This appears to be what you are entering for the image block url. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https://www.exxonmobillng.com/About-us/Interactive-map?utm_source=LNGTV&utm_medium=display&utm_campaign=PE_Map&utm_content=New_PE_Map This is what SS is producing when the page is loaded. https://ad.doubleclick.net/ddm/clk/491330615;298349270;l?https%3A%2F%2Fwww.exxonmobillng.com%2FAbout-us%2FInteractive-map%3Futm_source=LNGTV&utm_campaign=PE_Map&utm_content=New_PE_Map&utm_medium=display Obviously SS is encoding the url, which is screwing up the link and double click doesn't like it. Other than reporting this as a bug to SS the only work around I can think of would be to use Javascript to decode the url and replace the bad url. That would require the business plan or above. Well technically you might be able to build your own image block in a code block but that would be a pain. By the way I discovered the URLs you posted but to me they are hidden. I had to dig into the source of the forum page to see them. Okay thanks for clearing this up, makes total sense. Annoying on SS behalf but I guess we make do. We did actually get the client to send over some Javascript tags and they worked fine but the issue we had with that was SS wasn't resizing it for mobile so we couldn't use it. Do you potentially have some code that would resize a javascript tag? Or does it need to be embedded within the tag itself Thanks for all your help so far!
creedon Posted July 21, 2021 Posted July 21, 2021 If you're game for using Javascript I suggest the fix I suggested. Quote the only work around I can think of would be to use Javascript to decode the url and replace the bad url. I'm willing to give the code a go if you're up for it. It may take severals days for me to get to it. Bump this thread if I don't post soon. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
creedon Posted July 21, 2021 Posted July 21, 2021 Got to it sooner than expected! 🙂 Add the following to Settings > Advanced > Code Injection > HEADER. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> Add the following to Page Settings > Advanced > Page Header Code Injection for the page. <script> /* begin fix image block SS encoded query component links Version : 0.1d0 SS Versions : 7.0, 7.1 Dependancies : jQuery By : Thomas Creedon < http://www.tomsWeb.consulting/ > */ $( ( ) => { const urlPrefixMatches = [ /* url prefix matches are used to restrict which urls will be fixed. not all urls need to be fixed following is an example line. copy the example line below and paste after the example line. remove '// ' at beginning of pasted line. repeat for as many url prefixes you want to match */ // '[enter url prefix here between single quotes]', ]; // do not change anything below, there be the borg here const getUriParser = uri => { const parser = document.createElement ( 'a' ); parser.href = uri; return parser; }; $( '.sqs-block-image-link' ).each ( function ( ) { const $this = $( this ); let href = $this.attr ( 'href' ); if ( urlPrefixMatches.length ) { const m = urlPrefixMatches.find ( s => href.startsWith ( s ) ); if ( m === undefined ) return true; } const uriParser = getUriParser ( href ); uriParser.search = decodeURIComponent ( uriParser.search ); href = uriParser.toString ( ); $this.attr ( 'href', href ); } ); // end fix image block SS encoded query component links } ); </script> After the example url prefix matches line add the following. 'https://ad.doubleclick.net/', Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 21, 2021 Author Posted July 21, 2021 12 hours ago, creedon said: Got to it sooner than expected! 🙂 Add the following to Page Settings > Advanced > Page Header Code Injection for the page. <script> /* begin fix image block SS encoded query component links Version : 0.1d0 SS Versions : 7.0, 7.1 Dependancies : jQuery By : Thomas Creedon < http://www.tomsWeb.consulting/ > */ $( ( ) => { const urlPrefixMatches = [ /* url prefix matches are used to restrict which urls will be fixed. not all urls need to be fixed following is an example line. copy the example line below and paste after the example line. remove '// ' at beginning of pasted line. repeat for as many url prefixes you want to match */ // '[enter url prefix here between single quotes]', ]; // do not change anything below, there be the borg here const getUriParser = uri => { const parser = document.createElement ( 'a' ); parser.href = uri; return parser; }; $( '.sqs-block-image-link' ).each ( function ( ) { const $this = $( this ); let href = $this.attr ( 'href' ); if ( urlPrefixMatches.length ) { const m = urlPrefixMatches.find ( s => href.startsWith ( s ) ); if ( m === undefined ) return true; } const uriParser = getUriParser ( href ); uriParser.search = decodeURIComponent ( uriParser.search ); href = uriParser.toString ( ); $this.attr ( 'href', href ); } ); // end fix image block SS encoded query component links } ); </script> After the example url prefix matches line add the following. 'https://ad.doubleclick.net/', Let us know how it goes. Wow this is amazing! Thank you so much! Have I entered it in right? the URL still doesn't want to work 😕
creedon Posted July 21, 2021 Posted July 21, 2021 Replace the following line... /'['https://ad.doubleclick.net/',]', ...with... // '[enter url prefix here between single quotes]', 'https://ad.doubleclick.net/', Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 21, 2021 Author Posted July 21, 2021 10 minutes ago, creedon said: Replace the following line... /'['https://ad.doubleclick.net/',]', ...with... // '[enter url prefix here between single quotes]', 'https://ad.doubleclick.net/', Let us know how it goes. Still nothing unfortunately
creedon Posted July 21, 2021 Posted July 21, 2021 My bad. I updated my code post with the jQuery install step. Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nipper Posted July 26, 2021 Author Posted July 26, 2021 On 7/21/2021 at 6:15 PM, creedon said: My bad. I updated my code post with the jQuery install step. Let us know how it goes. It worked!!!! Great job Creedon, this was amazing. Thank you ever so much 🙂
Recommended Posts
Archived
This topic is now archived and is closed to further replies.