与您的 Google 联系人合作,为您的 Action Center 账号生成 Measurement ID。
在满足以下条件的所有网页上的 head 标记后面添加以下代码段:
可能会发生转化
已启用“通过 Google 预订”的所有 action_links 的着陆页。
没有现有的 Google Analytics 集成
如果这是您首次创建 Google Analytics 网站代码(gtag.js),请使用以下代码段:
<!--Globalsitetag(gtag.js)-GoogleAnalytics-->
<scriptasyncsrc="https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE"></script>
<script>
window.dataLayer=window.dataLayer||[];functiongtag(){dataLayer.push(arguments);}gtag('js',newDate());gtag('config','GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE',// Replace with Measurement ID{// DO NOT EDIT THE BELOW MENTIONED PARAMETERS// AS OVERRIDING RESULTS IN SENDING US PII INFORMATION.'referrer':undefined,'page_title':undefined,'page_path':undefined,'page_location':undefined,'send_page_view':false,'anonymize_ip':true,'groups':'reserve_with_google'});
</script>
现有的 Google Analytics 集成
如果您已为现有集成添加 Google Analytics 网站代码(gtag.js),请使用以下代码段:
gtag('config','GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE',//Replace with Measurement ID{'referrer':undefined,'page_title':undefined,'page_path':undefined,'page_location':undefined,'send_page_view':false,'anonymize_ip':true,'groups':'reserve_with_google'});
使用为您的账号生成的衡量 ID 更新上述代码段。
持久性 Action Center 网址参数
为了正确跟踪来自 action link 的转化,Google 会设置网址参数 rwg_token,该参数应在转化时返回。
您需要保留 rwg_token 网址参数,该参数将附加到您提供的所有操作链接中,在用户通过 Google 访问着陆页时,该参数的有效期最长为 30 天。保留此类信息的首选方式是使用 Cookie。
<script>
functiongetCookie(cname){varname=cname+"=";vardecodedCookie=decodeURIComponent(document.cookie);varca=decodedCookie.split(';');for(vari=0;i<ca.length;i++){varc=ca[i];while(c.charAt(0)==' '){c=c.substring(1);}if(c.indexOf(name)==0){returnc.substring(name.length,c.length);}}return"";}if(leadFromReserveWithGoogle()){// implement a function to identify the conversion is originating via Googlegtag('event','rwg_conversion',{'rwg_token':getCookie('_rwg_token'),'send_to':'reserve_with_google'});}
</script>
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eImplement Google Analytics conversion tracking for Actions Center Legacy Integration by obtaining a Measurement ID and adding the provided code snippet to relevant web pages.\u003c/p\u003e\n"],["\u003cp\u003ePersist the \u003ccode\u003erwg_token\u003c/code\u003e URL parameter, received via Google Action links, for up to 30 days using cookies to enable accurate conversion tracking.\u003c/p\u003e\n"],["\u003cp\u003eTrigger the conversion tracking event with the stored \u003ccode\u003erwg_token\u003c/code\u003e value when a user completes a transaction originating from a Google Place Action link using the provided code snippet and your own logic to identify Reserve with Google conversions.\u003c/p\u003e\n"],["\u003cp\u003eEnsure no Personal Identification Information (PII) is sent to Google during conversion tracking without explicit user consent or legal permission, by adhering to the provided code and guidelines.\u003c/p\u003e\n"]]],["To track conversions for Actions Center Legacy Integration, partners must first obtain a `Measurement ID` from Google and implement the provided Google Analytics site tag on relevant web pages, using the ID. Next, they must persist the `rwg_token` URL parameter from Google's action links, ideally via cookies, for up to 30 days. Finally, upon a user completing a transaction originating from Google, the provided script must be triggered, sending the `rwg_token` to complete conversion tracking, while excluding user PII.\n"],null,["# Supporting Google Analytics conversion tracking\n\n| **Objective:** Implement conversion tracking for Actions Center Legacy Integration using Google Analytics.\n| **Note:** Please ensure that as part of conversion data, user Personal Identification Information (PII) should **not** be sent to Google without expressed user consent or as otherwise permitted under law.\n| **Note:** Partners do **not** need to set up their own Google Analytics account in order to participate in conversion tracking.\n\n### Instructions\n\nThere are 3 phases for implementing conversion tracking:\n\n1. Setting up Google Analytics(GA) site tag\n2. Persisting Actions Center URL parameter\n3. Sending Conversion Data\n\n### Google Analytics site Tag setup.\n\nWork with you Google contact to generate a `Measurement ID`\nfor your Actions Center account.\n| **Key Point:** Store this Measurement ID , as this will be required to implement conversion tracking for your account.\n\nAdd the following code snippet after the `head` tags on all web pages\nthat:\n\n- a conversion can occur\n- the landing page for all `action_links` that are Reserve with Google enabled.\n\n#### No Existing Google Analytics Integration\n\nIf this is the first time creating a Google Analytics site(gtag.js), use the\nfollowing code snippet: \n\n```javascript\n\u003c!-- Global site tag (gtag.js) - Google Analytics --\u003e\n\u003cscript async src=\"https://www.googletagmanager.com/gtag/js?id=GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config',\n 'GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE', // Replace with Measurement ID\n {\n // DO NOT EDIT THE BELOW MENTIONED PARAMETERS\n // AS OVERRIDING RESULTS IN SENDING US PII INFORMATION.\n 'referrer' : undefined,\n 'page_title' : undefined,\n 'page_path': undefined,\n 'page_location': undefined,\n 'send_page_view': false,\n 'anonymize_ip': true,\n 'groups': 'reserve_with_google'\n });\n\u003c/script\u003e\n```\n\n#### Existing Google Analytics Integration\n\nIf you already have a Google Analytics site tag(gtag.js) for an existing\nintegration, use the following code snippet: \n\n```javascript\ngtag('config',\n 'GA_MEASUREMENT_ID_PROVIDED_BY_GOOGLE', //Replace with Measurement ID\n {\n 'referrer' : undefined,\n 'page_title' : undefined,\n 'page_path': undefined,\n 'page_location': undefined,\n 'send_page_view': false,\n 'anonymize_ip': true,\n 'groups': 'reserve_with_google'\n });\n```\n\nUpdate the above mentioned code snippets with the generated Measurement ID\nfor your account.\n\n### Persisting Actions Center URL Parameter\n\nTo properly track conversions from `action link`(s), Google will\nset a URL parameter `rwg_token`, which should be returned at the\ntime of a conversion.\n\nYou will be required to persist the `rwg_token` URL parameter\nwhich will be appended to all action links provided by you for a maximum\nduration of 30 days when a user visits the landing page via Google. The\npreferred way to persist this information is via cookies.\n| **Note:** The value of the `rwg_token` should be stored and returned without any edits.\n\n1. Add the following script on the landing page for all your `action_link`(s) that are Actions Center enabled.\n2. Update the rootdomain with your domain.\n\n```javascript\n\u003cscript\u003e\n var query = location.search.substring(1);\n var params = query.split('&');\n var rwg_token = undefined;\n for (var i = 0; i \u003c params.length; ++i) {\n var pair = params[i].split('=');\n if (pair[0] == 'rwg_token') {\n rwg_token = decodeURIComponent(pair[1]);\n break;\n }\n }\n if (typeof rwg_token == 'undefined') {\n document.cookie =\n \"_rwg_token=\" + rwg_token + \";max-age=2592000;domain=rootdomain.com;path=/\";\n }\n\u003c/script\u003e\n```\n\n### Sending Conversion Data\n\nWhen a user completes a transaction which originated from a Google Place\nAction link, you need to trigger the code mentioned below in order to\ncomplete conversion tracking.\n**Note:** When triggering this event, you will need to provide the `rwg_token` value described in the previous step. \n\n```javascript\n\u003cscript\u003e\n function getCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for(var i = 0; i \u003cca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }\n\n if (leadFromReserveWithGoogle()) { // implement a function to identify the conversion is originating via Google\n gtag('event', 'rwg_conversion', {\n 'rwg_token': getCookie('_rwg_token'),\n 'send_to': 'reserve_with_google'\n });\n }\n\u003c/script\u003e\n```"]]