i have been trying to find a where to add the google ads Purchase tracking event i have done some google search and i found one that said to do this but its for a older version of OC so wanted to know if someone could help or guide me in the correct direction
does this still work for success.twig ? if not is there a new way to do soIn the file catalog/view/theme/*/template/common/success.tplCode: Select all
<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'checkout/success') { ?> <!-- tracking code goes here --> <?php } ?>
or can i just put the event code in the success.twig like so
Code: Select all
{{ header }}
<!-- Event snippet for Purchase conversion page -->
<script>
gtag('event', 'conversion', {
'send_to': 'AW-*********/************',
'value': '{total}',
'transaction_id': '{order_id}'
});
</script>
Code: Select all
<ul class="breadcrumb">
{% for breadcrumb in breadcrumbs %}
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
{% endfor %}
</ul>
{% if j3.settings.get('pageTitlePosition') == 'top' %}
<h1 class="title page-title"><span>{{ heading_title }}</span></h1>
{% endif %}
{{ j3.loadController('journal3/layout', 'top') }}
<div id="common-success" class="container">
<div class="row">{{ column_left }}
{% if column_left and column_right %}
{% set class = 'col-sm-6' %}
{% elseif column_left or column_right %}
{% set class = 'col-sm-9' %}
{% else %}
{% set class = 'col-sm-12' %}
{% endif %}
<div id="content" class="{{ class }}">
{% if j3.settings.get('pageTitlePosition') == 'default' %}
<h1 class="title page-title">{{ heading_title }}</h1>
{% endif %}
{{ content_top }}
{{ text_message }}
<div class="buttons">
<div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
</div>
{{ content_bottom }}</div>
{{ column_right }}</div>
</div>
{{ footer }}