Post by magisterson » Fri Oct 18, 2019 10:36 pm

Hi guys I want to add gtag_report_conversion to final button on checkout page, but don't know how to do it. Help needed! :)

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm

Post by d3z1gnr » Sat Oct 19, 2019 3:41 am

The easiest way (well still requires a bit of learning curve) would be to use Google Tag Manager. GTM allows you to track button clicks. There are some really good Youtube videos on tracking page interactions using GTM. Since moving from just using Google Analytics, GTM has made doing this sort of tracking a breeze.

Mike Little
Director / Developer / Makes the coffee
Creative Digital Limited
http://www.creativedigital.co.nz


User avatar
Active Member

Posts

Joined
Mon Jan 18, 2010 2:59 pm
Location - Auckland, New Zealand

Post by magisterson » Sat Oct 19, 2019 8:57 pm

OK, here is the way how I made it. Maybe someone would like to use it in the future!

1. Add this code to: /catalog/controller/common/header.php

Code: Select all

$data['route'] = isset($this->request->get['route']) ? $this->request->get['route'] : 'common/home';
2. Add this if/else code to: /catalog/view/theme/default/template/common/header.twig (somewhere between <head> </head>)

Code: Select all

{% if route == 'checkout/success' %} 
<!-- Event snippet for YOUR GOOGLE TAG TITLE conversion page -->
Your GTAG conversion code here
{% endif %}
3. Upload files, clear cache, and done!

New member

Posts

Joined
Tue Jul 23, 2013 10:15 pm
Who is online

Users browsing this forum: paulfeakins and 34 guests