This site is probably overkill for the level of technical input I need for my query but the only other option is to ask Weebly support who are useless.
Essentially I have a tracking pixel from google to see when people have through adverts and bought something on our site.
However, the way you have to edit the site through Weebly's editor means that when you put the tracking pixel in, it is encoded with
<script type="html/template" id="tracking-pixel-receipt_page">
But the tracking pixel is itself a script:
<script type="html/template" id="tracking-pixel-receipt_page">
<!-- Google Code for Made a Sale Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 11111111;
var google_conversion_language = "en";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "ryOQCOuHhF0Q9tbjyAM";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src=" //www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/957934454/?label=ryOQCOuHhF0Q9tbjyAM&guid=ON&script=0"/>
</div>
</noscript>
</script>
So as you can see it comes encoded as HTML when I look at my site.
Because you can't get in there and edit on Weebly to type="text/javascript", I just wanted to ask you guys who I can get the tracking pixel to work with the script that Weebly forces it into.
Maybe this is very simple, but I have no experience with these things beyond basic HTML so forgive my ignorance.
Thanks for your assistance :)
There are a couple of things you could try.
See if the Weebly editor has a button for adding raw input or disabling the automatic encoding.
See if Weebly gives you direct access to the site header and footer file.
Contact Weebly and ask them to put the raw code in your site's footer.
Related
I have to load a snippet for adwords in my app, but I have a problem when try to do this, the pixel doesn't work.
This is the error I got:
Missing HTTP Response
I'm using ui.router and the snippet have to hit in a view (my goal):
<div>
more content here .....
......
......
<!-- Google Code Conversion Page -->
<script type="text/javascript">
var google_conversion_id = 925xxxxx;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "S-wiCLWKoGUQ_xxxxx";
var google_remarketing_only = false;
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/925xxxxx/?label=S-wiCLWKoGUQ_OfCuQM&guid=ON&script=0"/>
</div>
</noscript>
</div>
What is the best practice and solution for doing that in AngularJS??
Thank you!
my guess is that this doesn't relate to Angular. Missing HTTP response means that script is detected on the website, but doesn't execute. Would it work if you add http / https to src attribute?
Anyway, I would strongly recommend you to use something like Google Tag Manger to add such a tags, so you don't need to change source code everytime you need to change remarketing / conversion tag. This also helps you to avoid such a problems.
Debugging no HTTP response for AdWords. Official support pages.
Google Tag Manager - adding AdWords conversions
I am an newbie in Drupal, I have this javascript code to insert in a form on my website to add Google AdWords Conversion Tracking to the contact page.I cannot find the way to do it. Can someone help me.
<!-- Google Code for Formulaire en ligne Conversion Page --> <script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 00000000000;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "xxxxxxxxxxxxx"; var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript"
src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt=""
src="//www.googleadservices.com/pagead/conversion/00000000000/?label=xxxxxxxxxxxxx&guid=ON&script=0"/>
</div>
</noscript>
I've already use module Google AdWords Conversion Tracking but it doesn't work and don't know what I do wrong. So I want to add this code javascript but I don't how to do add a javascript code to a specific page.
In Admin we can create one node and post the java-script code inside the page editor.
I have a site that show ads.
These ads are JavaScript snippets given by the ads provider.
I'd like to know whether it's possible to automatically replace the JavaScript snippet of these ads in my page by another JavaScript snippet to show ads from other ad provider after some time user is browsing the page (say 1 minute).
I looked for a solution but I failed to find one.
So a practical example:
How to change the code below
<div id="myAd">
<div id="headbanner"><script type="text/javascript"><!--
google_ad_client = "ca-pub-2874724721134868";
/* girlsgamesalon-468x60 */
google_ad_slot = "4183777947";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>
by
<div id="myAd">
<script type="text/javascript">document.write("<scr" + "ipt type='text/javascript' src='http://advertising.youraddprovider.com/ad/getoffers/?instanceID=xx18fdbb471&" + Math.random() + "'></scri" + "pt>");</script>
</div>
after 1 minute that user is browsing the page.
Is impossible to change the javascript code. You have to haldle that with server side code, like php, c#.net, etc, etc.
Example in php:
if(someconditionismet)
{
echo "<script src='thejsfileforthiscase.js'></script>";
}
else
{
echo "<script src='theotherjsfile.js'></script>";
}
Update asked for the user:
You could use
document.write("<script src='javascriptfile.sj'></script>")
But it will delete the whole content of you page which mean that if you a html tag, document.write will delete and will write just the tags. There is a work around but as i told you, DO NOT USE IT.
And with server side, you have to learn php, or c#.net, asp.net, etc, etc. I already answered you. If you want i can give you some good toturials to start.
We use Google Ad Manager to serve ads. I would like to create a "Report this Ad" link that sends someone email about the problem, but it also needs to tell them the exact ad that was displayed at that moment.
There is a snippet of code that Google replaces with the ad code, example below.
<script type="text/javascript" language="javascript">
GA_googleFillSlot("replaced_description_300x514_3");
</script>
On the Google site we have an ad network setup which does the same thing, replacing it's code with an actual ad. A generic example of what that code might look like is below.
<!-- begin ad tag -->
<script language="JavaScript" type="text/javascript">
ord=Math.random()*10000000000000000;
document.write('<scr' + 'ipt language="JavaScript" src="http://ad.doubleclick.net/adj/removed-tag/removed-location-data;dma=removed-num;org=removed-org-type;state=removed-state;own=removed-owner;sz=728x90;ord=' + ord + '?" type="text/javascript"></scr' + 'ipt>');
</script><noscript><img src="http://ad.doubleclick.net/ad/removed-tag/removed-location-data;dma=removed-number;org=removed-org-type;state=removed-state;own=removed-owner;sz=728x90;ord=123456789?" width="728" height="90" border="0" alt=""></noscript>
<!-- End ad tag -->
We have several different networks that serve ads in a similar but different fashion.
Is there a bit of JavaScript magic that I could use to figure out the RESULT of those sets of JavaScript code? In other words, the image or flash file that was ultimately displayed? Can I read a list of all images in the DOM at some point using JavaScript?
I'm not sure where to start to figure out what ad is displaying. Of course, viewing source just shows the original Google code.
Here's a function that just grabs the innerHTML of the ad. Then, I wrap the ad in a form and add a hidden element (abcd_input) so that when they click on the link it updates the hidden value and submits the data to me. Not a perfect solution, as my sales reps need an actual "screen shot" of the ad itself, not the code of the ad. But, it gives a technical person all the info they probably need.
<script type="text/javascript">
function reportAd() {
var theAd = document.getElementById('abcd_div');
var theForm = document.getElementById('abcd_form');
var theInput = document.getElementById('abcd_input');
theInput.value = "";
theInput.value = theAd.innerHTML;
theForm.submit();
return false;
}
</script>
It seems that the answer is quite simple. Just throw a <DIV> around the contents and pull it's innerHTML attribute with JavaScript. That will tell you the full contents of that ad AFTER it's been modified.
Basically, Google Adwords give you a code so you can track how well your campaigns are working. You put in on your order thank you page to track and order, so you can see which keywords bring in the most orders. It gives me a code like this:
<!-- Google Code for Purchase/Sale Conversion Page -->
<script language="JavaScript" type="text/javascript">
<!--
var google_conversion_id = xxxxxxxxxx;
var google_conversion_language = "en";
var google_conversion_format = "1";
var google_conversion_color = "666666";
var google_conversion_label = "purchase";
//-->
</script>
<script language="JavaScript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/xxxxxxxxxx/?label=purchase&guid=ON&script=0"/>
</noscript>
When the user clicks one of my ads it sets a cookie with the keyword he clicked from etc, and then when he reaches this bit of a JS on the thank you page it realises he has a cookie and does the necessary tracking.
The problem is, for the thing I'm promoting right now the order thank you page is not on my server. I can place javascript on the page to track orders but only in the following format:
<SCRIPT language="javascript" src="xxxx"></SCRIPT>
With the 'xxxx' bit being the only thing I can change.
If I put the Google JS code in a file on my server, and then call the file on my server from his thank you page, will it achieve the same effect? If not is there any way to do this using what I have available?
If you are not tracking prices or anything but just conversions as defined by a page hit, then you could also go the iframe route. Have the client site open an iframe pointing to your server which then includes the googel code. Personally though, I think the pixel option is better, so long as it is not disallowed or ignored by Google (you will have to experiement to find out if this is the case)