Skip to content

Commit

Permalink
🐛 [Moengage analytics] Implements data center support (#38261)
Browse files Browse the repository at this point in the history
* integrated moengage analytics

* fixed the params and the endpoints.

* review comments fixed: changed the year to 2020, tests

* fixed test cases: missed an underscore

* added data center support in moengage analytics

* changed amp text
  • Loading branch information
nawazMoEngage committed Jul 18, 2022
1 parent 679cf2c commit 7859421
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/analytics-vendors.amp.html
Expand Up @@ -1161,7 +1161,7 @@
"a": {
"title": "${title}"
},
"e": "amp example button click"
"e": "AMP example button click"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions extensions/amp-analytics/0.1/test/vendor-requests.json
Expand Up @@ -327,8 +327,8 @@
"pagedcl": "https://engagement-collector.mobify.net/s.gif?slug=mobify-project-id&timestamp_local=_timestamp_&channel=web&dimensions=%7b%22platform%22%3a%22AMP%22%2c%22client_id%22%3a%22_client_id(sandy-client-id)_%22%2c%22title%22%3a%22_title_%22%2c%22location%22%3a%22_source_url_%22%2c%22page%22%3a%22_source_path_%22%2c%22src_location%22%3a%22_ampdoc_url_%22%2c%22referrer%22%3a%22_document_referrer_%22%2c%22templateName%22%3a%22page-type%22%7d&data=%7b%22category%22%3a%22timing%22%2c%22action%22%3a%22DOMContentLoaded%22%2c%22value%22%3a_content_load_time_%7d"
},
"moengage": {
"addDevice": "https://websdk.moengage.com/v2/device/add?os=mweb&app_id=!appId&sdk_ver=0.0.0&app_ver=1&device_tz=_timezone_&os_platform=_user_agent_&unique_id=_client_id(moe_uuid)_&device_ts=_timestamp_&isAmp=true&a=%5Bobject%20Object%5D&meta=%5Bobject%20Object%5D&url=_ampdoc_url_",
"event": "https://websdk.moengage.com/v2/report/add?os=mweb&app_id=!appId&sdk_ver=0.0.0&app_ver=1&device_tz=_timezone_&os_platform=_user_agent_&unique_id=_client_id(moe_uuid)_&device_ts=_timestamp_&a=%5Bobject%20Object%5D&meta=%5Bobject%20Object%5D&url=_ampdoc_url_"
"addDevice": "https://sdk-01.moengage.com/v2/device/add?os=mweb&app_id=!appId&sdk_ver=0.0.0&app_ver=1&device_tz=_timezone_&os_platform=_user_agent_&unique_id=_client_id(moe_uuid)_&device_ts=_timestamp_&isAmp=true&a=%5Bobject%20Object%5D&meta=%5Bobject%20Object%5D&url=_ampdoc_url_",
"event": "https://sdk-01.moengage.com/v2/report/add?os=mweb&app_id=!appId&sdk_ver=0.0.0&app_ver=1&device_tz=_timezone_&os_platform=_user_agent_&unique_id=_client_id(moe_uuid)_&device_ts=_timestamp_&a=%5Bobject%20Object%5D&meta=%5Bobject%20Object%5D&url=_ampdoc_url_"
},
"mparticle": {
"host": "https://pixels.mparticle.com",
Expand Down
7 changes: 4 additions & 3 deletions extensions/amp-analytics/0.1/vendors/moengage.json
@@ -1,15 +1,16 @@
{
"requests": {
"addDevice": "https://websdk.moengage.com/v2/device/add?os=${os}&app_id=${appId}&sdk_ver=${sdk_ver}&app_ver=${app_ver}&device_tz=${device_tz}&os_platform=${os_platform}&unique_id=${unique_id}&device_ts=${timestamp}&isAmp=true",
"event": "https://websdk.moengage.com/v2/report/add?os=${os}&app_id=${appId}&sdk_ver=${sdk_ver}&app_ver=${app_ver}&device_tz=${device_tz}&os_platform=${os_platform}&unique_id=${unique_id}&device_ts=${timestamp}"
"addDevice": "https://${dataCenter}.moengage.com/v2/device/add?os=${os}&app_id=${appId}&sdk_ver=${sdk_ver}&app_ver=${app_ver}&device_tz=${device_tz}&os_platform=${os_platform}&unique_id=${unique_id}&device_ts=${timestamp}&isAmp=true",
"event": "https://${dataCenter}.moengage.com/v2/report/add?os=${os}&app_id=${appId}&sdk_ver=${sdk_ver}&app_ver=${app_ver}&device_tz=${device_tz}&os_platform=${os_platform}&unique_id=${unique_id}&device_ts=${timestamp}"
},
"vars": {
"os": "mweb",
"sdk_ver": "0.0.0",
"app_ver": "1",
"device_tz": "${timezone}",
"os_platform": "${userAgent}",
"unique_id": "${clientId(moe_uuid)}"
"unique_id": "${clientId(moe_uuid)}",
"dataCenter": "sdk-01"
},
"extraUrlParams": {
"a": {
Expand Down

0 comments on commit 7859421

Please sign in to comment.