[Skip to main content](#vessel-content)

#   Error Embedding Google Ads Tag

##

- **[pqas](/forum/user/32448-pqas "View pqas's Profile")**
- [![pqas's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32448-pqas "View pqas's Profile") Topic Author
- [ Offline](/forum/user/32448-pqas)

Less More

- Posts: 11
- Thank you received: 0
-
-

2 years 5 months ago -  2 years 5 months ago [\#360939](#360939) by [pqas](/forum/user/32448-pqas "View pqas's Profile")  *[Error Embedding Google Ads Tag](/forum/27-checkout/908158-error-embedding-google-ads-tag#360939 "I'm trying to embed a google ad script tag in the frontend checkout view 'end' but keep getting &quot;syntax error, unexpected token &quot;")* was created by *[pqas](/forum/user/32448-pqas "View pqas's Profile")*

I'm trying to embed a google ad script tag in the frontend checkout view 'end' but keep getting "syntax error, unexpected token "&lt;", expecting end of file". I tried placing it after the "defined('_JEXEC') or die('Restricted access');" code block, no luck. Same thing when I place it after "echo JText::_('THANK_YOU_FOR_PURCHASE');" and after the last line of code "$this-&gt;nextButton = false;"

It seems like Php is not expecting the js script to be embedded which has me baffled with my limited PHP knowledge. Any ideas

Last edit: 2 years 5 months ago by [pqas](/forum/user/32448-pqas "View pqas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODE1OC1lcnJvci1lbWJlZGRpbmctZ29vZ2xlLWFkcy10YWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

2 years 5 months ago [\#360941](#360941) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Error Embedding Google Ads Tag](/forum/27-checkout/908158-error-embedding-google-ads-tag#360941 "I'm trying to embed a google ad script tag in the frontend checkout view 'end' but keep getting &quot;syntax error, unexpected token &quot;")*

Hi,

When you are in between the &lt;?php and the ?&gt; tags, you are inside PHP code. You can only write PHP code in there.
The last ?&gt; of a file can be omitted (which is usually the case).
Knowing all this, in the checkout / end view file, you want to either add your javascript code before the &lt;?php tag already there, or you want to add a ?&gt; tag at the end, and then add your javascript code.

Note also that we already provide a plugin for Google Analytics, which reports the ecommerce data, including sales to Google:
[ www.hikashop.com/marketplace/product/108...egration-google.html](https://www.hikashop.com/marketplace/product/108-integration-google.html)
You can then configure your Ads account to import the GA purchase events reported by the plugin:
[ support.google.com/analytics/answer/1063...11877394143257898-EU](https://support.google.com/analytics/answer/10632359?sjid=11611877394143257898-EU)

The following user(s) said Thank You: [pqas](/forum/user/32448-pqas "View pqas's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODE1OC1lcnJvci1lbWJlZGRpbmctZ29vZ2xlLWFkcy10YWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[pqas](/forum/user/32448-pqas "View pqas's Profile")**
- [![pqas's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32448-pqas "View pqas's Profile") Topic Author
- [ Offline](/forum/user/32448-pqas)

Less More

- Posts: 11
- Thank you received: 0
-
-

2 years 5 months ago -  2 years 5 months ago [\#360954](#360954) by [pqas](/forum/user/32448-pqas "View pqas's Profile")  Replied by *[pqas](/forum/user/32448-pqas "View pqas's Profile")* on topic *[Error Embedding Google Ads Tag](/forum/27-checkout/908158-error-embedding-google-ads-tag#360954 "I'm trying to embed a google ad script tag in the frontend checkout view 'end' but keep getting &quot;syntax error, unexpected token &quot;")*

Very helpful

Last edit: 2 years 5 months ago by [pqas](/forum/user/32448-pqas "View pqas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwODE1OC1lcnJvci1lbWJlZGRpbmctZ29vZ2xlLWFkcy10YWc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.086 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
