Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove loadSegment related logic (leveraged GTM) #1217

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Binary file not shown.
230 changes: 228 additions & 2 deletions qdrant-landing/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions qdrant-landing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"comments": {
"dependencies": {
"@qdrant/qdrant-analytics-events": "qdrant-2024",
"@segment/analytics-next": "qdrant-2024",
"@splidejs/splide": "qdrant-2024",
"anchor-js": "qdrant-2024",
"bootstrap": "qdrant-2024",
Expand All @@ -17,6 +19,8 @@
}
},
"dependencies": {
"@qdrant/qdrant-analytics-events": "file:lib/qdrant-analytics-events-1.0.14.pre-release.tgz",
"@segment/analytics-next": "^1.75.0",
"@splidejs/splide": "^4.1.4",
"anchor-js": "^5.0.0",
"bootstrap": "^5.3.2",
Expand Down
7 changes: 2 additions & 5 deletions qdrant-landing/themes/qdrant-2024/assets/js/cookit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getCookie, setCookie } from './helpers';
import { loadSegment, handleConsent } from './segment-helpers';
import { handleConsent } from '../ts/segment-helpers';

(function () {
window.cookit = function (options) {
Expand Down Expand Up @@ -59,10 +59,7 @@ import { loadSegment, handleConsent } from './segment-helpers';

// EVENT LISTENER (click)
button.addEventListener('click', () => {
if (!window.analytics) {
loadSegment();
handleConsent();
}
handleConsent();

banner.remove();
setCookie('cookie-consent', 1, settings.lifetime);
Expand Down
2 changes: 1 addition & 1 deletion qdrant-landing/themes/qdrant-2024/assets/js/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const CROSS_SITE_URL_PARAM_KEY = 'ajs_anonymous_id';
export function tagCloudUILinksWithAnonymousId() {
const targetUrl = 'https://cloud.qdrant.io/';

const anonymousId = analytics.user().anonymousId();
const anonymousId = getCookie(CROSS_SITE_URL_PARAM_KEY);

// Function to add or update query parameter in the URL
function addOrUpdateQueryParam(url, paramName, paramValue) {
Expand Down
Loading
Loading