Skip to content
This repository has been archived by the owner on Jan 23, 2025. It is now read-only.

Update segment script to support user consent #41

Open
jswheeler opened this issue Jun 4, 2020 · 1 comment
Open

Update segment script to support user consent #41

jswheeler opened this issue Jun 4, 2020 · 1 comment

Comments

@jswheeler
Copy link

Expected behavior

Describe.
The connect app should support the segment 4.1.0 javascript app to support user consent (below).

<script>
  !function(){var analytics=window.analytics=window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","reset","group","track","ready","alias","debug","page","once","off","on","addSourceMiddleware","addIntegrationMiddleware","setAnonymousId","addDestinationMiddleware"];analytics.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);analytics.push(t);return analytics}};for(var e=0;e<analytics.methods.length;e++){var t=analytics.methods[e];analytics[t]=analytics.factory(t)}analytics.load=function(e,t){var n=document.createElement("script");n.type="text/javascript";n.async=!0;n.src="https://cdn.segment.com/analytics.js/v1/"+e+"/analytics.min.js";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a);analytics._loadOptions=t};analytics.SNIPPET_VERSION="4.1.0";
  analytics.load("o9nnBWWDraSZHiuruzcSfaNVJFphGq5G");
  analytics.page();
  }}();
</script>

Additionally,
The following process should be followed to implement consent manager
https://github.com/segmentio/consent-manager#standalone-script

Specifically:

  • The consent code should be included on the same page as this analytics script
  • The analytics.load function should be commented out.
  • The cookieDomain string should be set to topcoder.com

Actual behavior

Describe.
The current app is version 4.0.0.

Steps to reproduce the problem

Load any page.

Screenshot/screencast

Attach or link a resource.
this file needs to be updated.
https://github.com/topcoder-platform/tc-website/blob/dev/src/main/com/topcoder/web/jsp/foot.jsp

--

Environment

  • OS:
  • Browser (w/version):
  • User role (client, copilot or manager):
  • Account used:
@jswheeler
Copy link
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant