I’ve seen this asked several times in the forum, but the answers never seem to have enough detail.
Here are the two js snippets required to setup the conversion.
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-1098xxxxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-1098xxxxx');
</script>
<!-- Event snippet for Credits Purchased conversion page
In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. -->
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-1098xxxxx/sk1bxxxxxx-PQo',
'value': 10.0,
'currency': 'USD',
'transaction_id': '',
'event_callback': callback
});
return false;
}
</script>
Here is the current setup in Zaraz
Ads Questions:
- Should the conversion label be ‘AW-1098xxxxx/sk1bxxxxxx-PQo’ or ‘/sk1bxxxxxx-PQo’?
- Do I need to load the gtag script separately via Zaraz HTML?
- Why does the tool setup page have “zaraz.tool.details.settings.header.undefined” on it?
- The Ads UI is showing the tag as ‘inactive’ and the conversion status as ‘inactive’.
What do I need to do to verify the tag? - Is there only one type of debug log for G Ads? I notice with GA4, there are several including a URL that sends data.
- How does this recent change affect the setup?
Get the conversionId from ComponentSettings, not only from the payload · Issue #2 · managed-components/google-ads · GitHub
Other Notes:
I can not read the source code GitHub - managed-components/google-ads: Google Ads Managed Component.
I get one of two errors.
- "Failed to load latest commit information. "
- “Error loading page”
But I can read the code for other components.