Jump to content

How to install Adroll Pixel in my Prestahop Store


Recommended Posts

Hi guys,

 

I'm trying to install the Adroll pixel in my website but when I add it into footer.tpl (as for example the GA Script) it makes the footer and some areas to disappear.

 

The code is this

 

 

<script type="text/javascript">

adroll_adv_id = "BDPQAKSV7VCTNJ22FSOUGM";

adroll_pix_id = "JRE43QD62ZAZPP3GL7IHWQ";

(function () {

var oldonload = window.onload;

window.onload = function(){

__adroll_loaded=true;

var scr = document.createElement("script");

var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");

scr.setAttribute('async', 'true');

scr.type = "text/javascript";

scr.src = host + "/j/roundtrip.js";

((document.getElementsByTagName('head') || [null])[0] ||

document.getElementsByTagName('script')[0].parentNode).appendChild(scr);

if(oldonload){oldonload()[spam-filter];

}());

</script>

 

 

Has anybody tried to install it as well? Any help?

 

Thanks in advance,

Link to comment
Share on other sites

Hey JuanLaSambuca,

 

I work at AdRoll and thought I'd try to help out. In order for prestashop to successfully read the javascript you've added, I believe you need to embed it within {litearl} {/literal}. It should look like below:

 

{literal}

<script type="text/javascript">

adroll_adv_id = "BDPQAKSV7VCTNJ22FSOUGM";

adroll_pix_id = "JRE43QD62ZAZPP3GL7IHWQ";

(function () {

var oldonload = window.onload;

window.onload = function(){

__adroll_loaded=true;

var scr = document.createElement("

script");

var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");

scr.setAttribute('async', 'true');

scr.type = "text/javascript";

scr.src = host + "/j/roundtrip.js";

((document.getElementsByTagName('head') || [null])[0] ||

document.getElementsByTagName('script')[0].parentNode).appendChild(scr);

if(oldonload){oldonload()[spam-filter];

}());

</script>

{/literal}

 

Hope this helps!

Link to comment
Share on other sites

Hi SamG,

 

Thanks for this :-)

 

Where do you think should I include this code? I mean in which file should I paste this code if what I want to show users (Retargeting) are the product they have add to the cart? I guess if my goal is to re-show them any product they have checked, I should paste it on product.tpl. Is that right?

 

thanks in advance

Link to comment
Share on other sites

  • 11 months later...

JuanLaSambuca Have you found a solution of where include the code ?

use this code:

{literal}
<script type="text/javascript">
adroll_adv_id = "BDPQAKSV7VCTNJ22FSOUGM";
adroll_pix_id = "JRE43QD62ZAZPP3GL7IHWQ";
(function () {
var oldonload = window.onload;
window.onload = function(){
__adroll_loaded=true;
var scr = document.createElement("
script");
var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
scr.setAttribute('async', 'true');
scr.type = "text/javascript";
scr.src = host + "/j/roundtrip.js";
((document.getElementsByTagName('head') || [null])[0] ||
document.getElementsByTagName('script')[0].parentNode).appendChild(scr);
if(oldonload){oldonload()[spam-filter];
}());
</script>
{/literal}

paste it into the header.tpl file located in your theme directory

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
  • 2 months later...
  • 3 weeks later...
  • 1 month later...

Hi,

 

Please I have the same problem and appear some issues every time I try to implement the Pixel of Adroll.

 

I get this erro.

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/topminer/public_html/themes/leotrac/header.tpl" on line 48 "if(oldonload){oldonload()[spam-filter];" unknown function "oldonload"' in /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(2900): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown functio...') #1 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r153() #2 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3201): Smarty_Internal_Templateparser->yy_reduce(153) #3 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(17, '}') #4 /home/topminer/public_html/tools/smarty/sysplugins/smar in /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667

 

Someone can help? :s

 

Thanks.

Link to comment
Share on other sites

Hi,

 

Please I have the same problem and appear some issues every time I try to implement the Pixel of Adroll.

 

I get this erro.

 

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/home/topminer/public_html/themes/leotrac/header.tpl" on line 48 "if(oldonload){oldonload()[spam-filter];" unknown function "oldonload"' in /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(2900): Smarty_Internal_TemplateCompilerBase->trigger_template_error('unknown functio...') #1 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3101): Smarty_Internal_Templateparser->yy_r153() #2 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templateparser.php(3201): Smarty_Internal_Templateparser->yy_reduce(153) #3 /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(17, '}') #4 /home/topminer/public_html/tools/smarty/sysplugins/smar in /home/topminer/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667

 

Someone can help? :s

 

Thanks.

 

 

do you use {literal} {/literal} tags to prevent interpreting brackets as a smarty syntax?

Link to comment
Share on other sites

  • 8 months later...
  • 3 weeks later...

Thanks Vekia, I did it but unfortunatelly seams that the same page, with different parameters are loaded from PayPal modules also for other purposes so the Target stats are incorrect.

 

Then all modules are different and use different confirmation pages and some of them don't load any html code so is impossible to track them. It is really creazy that there is not a standard confirmation page for all modules that can be tracked.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...