Page 1 of 1

Integrating AdWords remarketing code to Opencart.

Posted: Sun Jan 20, 2019 9:02 pm
by Imass
Hi. I am using Opencart 2.3.0.2 and i try to integrate google AdWords remarketing tags.
Actualy for Global Site tag there is no problem because i just add it in my header. But i have also a Event snipped, which look like this:

Code: Select all

<script>
  gtag('event', 'page_view', {
    'send_to': 'AW-XXXXXXX',
    'dynx_itemid': 'replace with value',
    'dynx_itemid2': 'replace with value',
    'dynx_pagetype': 'replace with value',
    'dynx_totalvalue': 'replace with value',
    'user_id': 'replace with value'
  });
</script>
So that should be configured to take correct data in placeholders (replace with value). Otherwise i see message in my AdWords dashboard (
Your Google Ads tag is missing "item ID")
I looking for some advises how can i fix that or if there is some working and tested plugins that i can use for that remarketing configuration.

Re: Integrating AdWords remarketing code to Opencart.

Posted: Fri Feb 28, 2020 1:18 pm
by cedcommerceteam
Hi there,

As " replace with value " fields should have data so you could replace it with following :

Code: Select all

<script>
var item_id = document.getElementById("ID OF ITEM ID FIELD").value;
var itemid2 = document.getElementById("ID OF ITEM ID 2 FIELD").value;
var pagetype = document.getElementById("ID OF PAGE TYPE FIELD").value;
var totalvalue = document.getElementById("ID OF TOTAL VALUE FIELD").value;
var user_id = document.getElementById("ID OF USER ID FIELD").value;

gtag('event', 'page_view', {
'send_to': 'AW-XXXXXXX',
'dynx_itemid': item_id,
'dynx_itemid2': itemid2,
'dynx_pagetype': pagetype,
'dynx_totalvalue': totalvalue,
'user_id': user_id
});
</script>
In this way each field value will be assigned & Your Google Ads tag is missing "item ID" issue won't show again.

Once check for mandatory fields, if any of them is not required then you may leave it blank.

If you still have any query do PM me.

Thanks & Regards :

Re: Integrating AdWords remarketing code to Opencart.

Posted: Mon Oct 19, 2020 9:46 am
by batustun
Thank you. Can you fill these fields for example? I dont understand what i should write to this fields.

cedcommerceteam wrote:
Fri Feb 28, 2020 1:18 pm
Hi there,

As " replace with value " fields should have data so you could replace it with following :

Code: Select all

<script>
var item_id = document.getElementById("ID OF ITEM ID FIELD").value;
var itemid2 = document.getElementById("ID OF ITEM ID 2 FIELD").value;
var pagetype = document.getElementById("ID OF PAGE TYPE FIELD").value;
var totalvalue = document.getElementById("ID OF TOTAL VALUE FIELD").value;
var user_id = document.getElementById("ID OF USER ID FIELD").value;

gtag('event', 'page_view', {
'send_to': 'AW-XXXXXXX',
'dynx_itemid': item_id,
'dynx_itemid2': itemid2,
'dynx_pagetype': pagetype,
'dynx_totalvalue': totalvalue,
'user_id': user_id
});
</script>
In this way each field value will be assigned & Your Google Ads tag is missing "item ID" issue won't show again.

Once check for mandatory fields, if any of them is not required then you may leave it blank.

If you still have any query do PM me.

Thanks & Regards :