Thanks for your time. The snippet I get from adwords and google ads api looks different. I have added the steps for both api below and the snippets. Please let me know if any one snippet from Google Ads API remarketing action same as snippet from adwords ?
In Google.Api.Ads.AdWords.v201809, I do the following steps.
1. Create a CustomerClient
2. Get a Customer using its customerId.
3. Get Remarketing Tag snippet from Customer using customer.remarketingSettings.snippet . The sample of the snippet mentioned below.
<!-- Google Code for Remarketing Tag --> <!-------------------------------------------------- Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup --------------------------------------------------->
<script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = xxxxxxxxx; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;"> <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/xxxxxxxxx?guid=ON&script=0"/> </div>
</noscript>
As you suggested, I used
remarketing_action resource to get tag_snippets in GoogleAdAPI V1.0 . Please find its steps below.
1. Create a CustomerClient
2. Create a RemarketingAction using its customerId.
3. Get Remarketing action using RemarketingActionResourceName from step 2.
4. I get 4 tag snippets . I posted the two snippets for HTML page format.
Type : WebpageOnclick
PageFormat: HTML
EventSnippet:
<!-- Event snippet for remarkingaction 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_remarketing_only': true,
'event_callback': callback
});
return false;
}
</script>
Type : Webpage
PageFormat:HTML
EventSnippet:
<!-- Event snippet for remarkingaction remarketing page -->
<script>
gtag('event', 'conversion', {
'send_to': '',
'aw_remarketing_only': true
});
</script>