Is it necessary to URL escape the url in following js?
onclick="javascript: pageTracker._trackPageview('/internet/xyz/de/privatkunden.-Slot1-0113-File.File.FileRef.pdf/äü&.pdf');" href="/internet/xyz/de/privatkunden.-Slot1-0113-File.File.FileRef.pdf/äü&.pdf"
I JS-escaped it, before i write it on the page to make sure my JS will still work, but I'm not sure if URL escaping is required by google.
I couldn't find anything in the docs and on this board that said yes or no.
Thank you.
You don't need to escape your URL, the ga script do it for you.
äü&.pdf will be escaped as %25C3%25A4%25C3%25BC%26.pdf
Yes it works, but you should use this if you can:
Use the Async Snippet and then this:
<a onclick="_gaq.push(['_trackPageview', '/internet/xyz/de/privatkunden.-Slot1-0113-File.File.FileRef.pdf/äü&.pdf']);" href="/internet/xyz/de/privatkunden.-Slot1-0113-File.File.FileRef.pdf/äü&.pdf" target="_blank">pdf file name link</a>
The correct way to track a download link is by using the event tracking.
https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
It's very similar to what you did - here is the code - _trackEvent(category, action, opt_label, opt_value, opt_noninteraction)
For example:
Download <strong>ZIP File</strong>
Related
Is there a way to add the following script, required by Google Programmable Search to Google Tag Manager? Just trying to minimize separate scripts included in my code.
<script async src="https://cse.google.com/cse.js?cx=e14513e5d62xxxxxx"></script>
NM, figured it out. In case someone cares, here's how you do it:
Keep the code part where you want to include your search in the page code.
The above script can be added to GTM via Custom HTML tag. Just drop it there and it's done.
Cheers
I would like to ask you if it is possible to disable the html tags for the Routing API response.
For example:
Go to the <span class="company">U</span> station
<span class="station">U Pankstr. (Berlin)</span>
and take the <span class="transit">rail</span>
<span class="line">U8</span> towards
is the response. I would like to have this as a result:
Go to the U station
U Pankstr. (Berlin)
and take the rail
U8 towards
My api call is like the example api call from here:
https://developer.here.com/documentation/routing/dev_guide/topics/request-a-simple-route.html
It would be great if I could disable the html tags.
Thanks in advance.
If you add instructionFormat to text you get the instructions without the html tags. Example:
https://route.api.here.com/routing/7.2/calculateroute.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&waypoint0=geo!52.5,13.4
&waypoint1=geo!52.5,13.45
&instructionFormat=text
&mode=fastest;car;traffic:disabled
With Crawler4j, I can fetch page linked by a complete url, such as:
<a href='http://www.domain.com/thelink'>
However I found that if the link is relative, such as:
<a href='/thelink'>
Crawler4j will bypass this link(page), and I even have no chance to see the link in shouldVisit(Page referringPage, WebURL url) method.
I do not see any configuration about this in Crawler4j Github page, do I miss something?
As described in the related issue on the project page, it seems that this behaviour is related to the fact, that this specific web-page does a lot of rendering content using ajax / javascript.
However, crawler4j is not able to render javascript styling on demand as it does not include a javascript engine for this purpose. In addition, the script tag is not scanned for URLS yet.
How I can disable javascript codes from iframe:
<iframe style="visibility:hidden;display:none" src="http://page.pl/" width="0" height="0"></iframe>
Is it possible?
I can't do it by PHP (using file_get_contents() and regex) because web page from iframe must create a cookies into visitor's browser.
This may give you a starting point. Basically if you look at enter link CKEditor when you switch from View mode to Source mode. You can see when you enter a sample of javascript code and switch to source code, it will make encoded string which disable the java script execution.
Let me know if you want to see the implementation details of the javascript string encoding.
I want to send an email with attachments using CDONTS. But, here is what i am using:
CDO_MAIL.AttachFile "http://SampleWebSite.com/Sample.asp?COMMAND=6"
In JavaScript we are doing:
image1.src = "http://SampleWebSite.com/Sample.asp?COMMAND=6"
The problem is - I do not have the exact image name. The above URL returns me an image. Can you please let me know how to resolve this ?
Thanks
Diodeus is correct. However, another way to "solve" this is to download the file so you have it locally and then attach it. Embedding in the HTML, as suggested by Diodeus, will cause most mail clients to block the image and require user interaction to download the image. It's better to do it attach it and reference it by CID.
CDO does not support HTTP. It's expecting a local file reference (C:....).
You can embed the image in the message body though, using simple HTML:
<img src="http://SampleWebSite.com/Sample.asp?COMMAND=6" />