Jump to content

Unable to add tracking script in complete.tpl page


Recommended Posts

On complete.tpl page in {if $ispaid} conditions I am trying to implement following code even after using {literal} the variables are not getting correctly.  And what is exact variable for email of customer?

My code 

{if $ispaid}
        <!-- Enter any HTML code which should be displayed when a user has completed checkout here -->
        <!-- Common uses of this include conversion and affiliate tracking scripts -->

<script>
fbq('track', 'Purchase', {currency: "INR", value: '{literal}{$amount}{/literal}'});
</script>
      
<script>
  var enhanced_conversion_data = {
    "email": '{literal}{$clientsdetails.email}{/literal}'  
  }; 
</script>

{literal}
<!-- Global site tag (gtag.js) - Google Ads: 96###### -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-96#####0"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config','AW-9#####0', {'allow_enhanced_conversions':true});
</script>
{/literal}

      <script>
        gtag('event', 'conversion', {
        'send_to': 'AW-96#####0/tYVjC#####I68oD',
        'value': '{literal}{$amount}{/literal}',
        'currency': 'INR',
        });
     </script>

        {/if}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated