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 adroll #4029

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ COMMIT_SHA="dev"
# Analitycs
MIXPANEL_ENV="development"
MIXPANEL_KEY="b10b850880cb0a8557d878c2e6024d03"
ADROLL_ADV_ID="5VWGFTJXUZF6BPUDCH3WWM"
ADROLL_PIX_ID="4PSXWPAQTJEIXJSPHJCRW4"

# RPCs
INFURA_PROJECT_ID="de82b2d602264e4fbc0929dec0c45baa"
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/aws-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ jobs:
--build-arg AJNA_SUBGRAPH_V2_URL_GOERLI=${{ secrets.AJNA_SUBGRAPH_V2_URL_GOERLI }} \
--build-arg MIXPANEL_ENV=production \
--build-arg MIXPANEL_KEY=${{ secrets.MIXPANEL_KEY_PROD }} \
--build-arg ADROLL_ADV_ID=${{ secrets.ADROLL_ADV_ID_PROD }} \
--build-arg ADROLL_PIX_ID=${{ secrets.ADROLL_PIX_ID_PROD }} \
--build-arg MAINNET_CACHE_URL=${{ secrets.MAINNET_CACHE_URL_PROD }} \
--build-arg INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID_PROD }} \
--build-arg ETHERSCAN_API_KEY=${{ secrets.ETHERSCAN_API_KEY }} \
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/aws-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:

- name: Check required secrets
env:
ADROLL_ADV_ID_STAGING: ${{ secrets.ADROLL_ADV_ID_STAGING }}
ADROLL_PIX_ID_STAGING: ${{ secrets.ADROLL_PIX_ID_STAGING }}
AJNA_SUBGRAPH_URL_GOERLI: ${{ secrets.AJNA_SUBGRAPH_URL_GOERLI }}
AJNA_SUBGRAPH_URL_STAGING: ${{ secrets.AJNA_SUBGRAPH_URL_STAGING }}
AJNA_SUBGRAPH_V2_URL_GOERLI: ${{ secrets.AJNA_SUBGRAPH_V2_URL_GOERLI }}
Expand All @@ -48,7 +46,7 @@ jobs:
NEWSLETTER_PUBLICATION_ID: ${{ secrets.NEWSLETTER_PUBLICATION_ID }}
NEWSLETTER_ENDPOINT: ${{ secrets.NEWSLETTER_ENDPOINT }}
run: |
required_secrets=("AJNA_SUBGRAPH_URL_STAGING" "AJNA_SUBGRAPH_URL_GOERLI" "AJNA_SUBGRAPH_V2_URL_STAGING" "AJNA_SUBGRAPH_V2_URL_GOERLI" "MIXPANEL_KEY_STAGING" "ADROLL_ADV_ID_STAGING" "ADROLL_PIX_ID_STAGING" "MAINNET_CACHE_URL_STAGING" "INFURA_PROJECT_ID_STAGING" "ETHERSCAN_API_KEY" "BLOCKNATIVE_API_KEY_STAGING" "SENTRY_AUTH_TOKEN" "PRODUCT_HUB_KEY" "ONE_INCH_API_KEY_STAGING" "ONE_INCH_API_URL_STAGING" "REFERRAL_SUBGRAPH_URL_STAGING" "NEWSLETTER_API_KEY" "NEWSLETTER_PUBLICATION_ID" "NEWSLETTER_ENDPOINT")
required_secrets=("AJNA_SUBGRAPH_URL_STAGING" "AJNA_SUBGRAPH_URL_GOERLI" "AJNA_SUBGRAPH_V2_URL_STAGING" "AJNA_SUBGRAPH_V2_URL_GOERLI" "MIXPANEL_KEY_STAGING" "MAINNET_CACHE_URL_STAGING" "INFURA_PROJECT_ID_STAGING" "ETHERSCAN_API_KEY" "BLOCKNATIVE_API_KEY_STAGING" "SENTRY_AUTH_TOKEN" "PRODUCT_HUB_KEY" "ONE_INCH_API_KEY_STAGING" "ONE_INCH_API_URL_STAGING" "REFERRAL_SUBGRAPH_URL_STAGING" "NEWSLETTER_API_KEY" "NEWSLETTER_PUBLICATION_ID" "NEWSLETTER_ENDPOINT")
fail=false
for secret in "${required_secrets[@]}"; do
secret_value=$(printenv $secret)
Expand Down Expand Up @@ -99,8 +97,6 @@ jobs:
AJNA_SUBGRAPH_V2_URL_GOERLI: ${{ secrets.AJNA_SUBGRAPH_V2_URL_GOERLI }}
MIXPANEL_ENV: staging
MIXPANEL_KEY: ${{ secrets.MIXPANEL_KEY_STAGING }}
ADROLL_ADV_ID: ${{ secrets.ADROLL_ADV_ID_STAGING }}
ADROLL_PIX_ID: ${{ secrets.ADROLL_PIX_ID_STAGING }}
MAINNET_CACHE_URL: ${{ secrets.MAINNET_CACHE_URL_STAGING }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID_STAGING }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
Expand Down Expand Up @@ -177,4 +173,4 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OasisDEX/e2e-tests/actions/workflows/ci_e2e_tests.yml/dispatches \
-d "{\"ref\":\"main\", \"inputs\":{\"run_id\":\"${{ github.run_id }}\"}}"
echo 'See test results in https://github.com/OasisDEX/e2e-tests/actions/workflows/ci_e2e_tests.yml --> Job with RUN_ID ${{ github.run_id }} in the logs.'
echo 'See test results in https://github.com/OasisDEX/e2e-tests/actions/workflows/ci_e2e_tests.yml --> Job with RUN_ID ${{ github.run_id }} in the logs.'
2 changes: 0 additions & 2 deletions .github/workflows/dockerhub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
docker build --build-arg COMMIT_SHA=${{ env.SHA_TAG }} \
--build-arg MIXPANEL_ENV=staging \
--build-arg MIXPANEL_KEY=${{ secrets.MIXPANEL_STAGING_KEY }} \
--build-arg ADROLL_ADV_ID=${{ secrets.ADROLL_ADV_ID_STAGING }} \
--build-arg ADROLL_PIX_ID=${{ secrets.ADROLL_PIX_ID_STAGING }} \
--build-arg MAINNET_CACHE_URL=${{ secrets.MAINNET_CACHE_URL }} \
--build-arg INFURA_PROJECT_ID=${{ secrets.INFURA_PROJECT_ID }} \
--build-arg ETHERSCAN_API_KEY=${{ secrets.ETHERSCAN_API_KEY }} \
Expand Down
4 changes: 0 additions & 4 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ ARG COMMIT_SHA='' \
AJNA_SUBGRAPH_V2_URL_GOERLI='' \
MIXPANEL_ENV='' \
MIXPANEL_KEY='' \
ADROLL_ADV_ID='' \
ADROLL_PIX_ID='' \
MAINNET_CACHE_URL='' \
SHOW_BUILD_INFO='' \
ETHERSCAN_API_KEY='' \
Expand All @@ -48,8 +46,6 @@ ENV COMMIT_SHA=$COMMIT_SHA \
AJNA_SUBGRAPH_V2_URL_GOERLI=$AJNA_SUBGRAPH_V2_URL_GOERLI \
MIXPANEL_ENV=$MIXPANEL_ENV \
MIXPANEL_KEY=$MIXPANEL_KEY \
ADROLL_ADV_ID=$ADROLL_ADV_ID \
ADROLL_PIX_ID=$ADROLL_PIX_ID \
MAINNET_CACHE_URL=$MAINNET_CACHE_URL \
ETHERSCAN_API_KEY=$ETHERSCAN_API_KEY \
BLOCKNATIVE_API_KEY=$BLOCKNATIVE_API_KEY \
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ git clone https://github.com/OasisDEX/oasis-borrow.git

Navigate to the project folder and install all dependencies

NOTE: to install private packages from NPM you need to have an env variable called `NPM_TOKEN` containing your personal NPM access token.
We recommend to set `NPM_TOKEN` in your `.env` file using our `.env.template`, this way you can just `source .env` before install.
NOTE: to install private packages from NPM you need to have an env variable called `NPM_TOKEN`
containing your personal NPM access token. We recommend to set `NPM_TOKEN` in your `.env` file using
our `.env.template`, this way you can just `source .env` before install.

```sh
source .env
Expand Down Expand Up @@ -136,12 +137,6 @@ PRODUCT_HUB_KEY="<any value of your choice>"
- `MIXPANEL_KEY` - The value will be used for `production` environments. This is the project key
that is generated from Mixpanel.

- `ADROLL_PIX_ID` - The value will be used for `production` environments. This is the project key
that is generated from AdRoll Pixel.

- `ADROLL_ADV_ID` - The value will be used for `production` environments. This is the project key
that is generated from AdRoll Pixel.

- `USE_TERMS_OF_SERVICE` - In order to use some functionalities the user should read and accept
Terms of Service. For development purposes, this feature can be disabled. You can disable this
feature if you'd like to remove that functionality at all. The values are either `0` (disabled) or
Expand Down
31 changes: 0 additions & 31 deletions analytics/adroll.ts

This file was deleted.

2 changes: 1 addition & 1 deletion analytics/manageCookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { CookieName, Switch } from './common'
export const manageCookie: Record<CookieName, Switch> = {
marketing: {
enable: () => {},
disable: () => {}, // no needed since adding adRoll instance to app is 0/1 like
disable: () => {},
},
analytics: {
enable: () => mixpanel.opt_in_tracking(),
Expand Down
6 changes: 4 additions & 2 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CacheProvider, Global } from '@emotion/core'
import { Web3OnboardProvider } from '@web3-onboard/react'
import type { AbstractConnector } from '@web3-react/abstract-connector'
import { Web3ReactProvider } from '@web3-react/core'
import { adRollPixelScript } from 'analytics/adroll'
import { COOKIE_NAMES_LOCASTORAGE_KEY } from 'analytics/common'
import { mixpanelInit } from 'analytics/mixpanel'
import { trackingEvents } from 'analytics/trackingEvents'
Expand Down Expand Up @@ -155,7 +154,10 @@ function App({ Component, pageProps }: AppProps & CustomAppProps) {
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
{cookiesValue?.enabledCookies?.marketing && (
<Script dangerouslySetInnerHTML={{ __html: adRollPixelScript }} async />
// Use when there is a need to load extra script required for marketing
// Example usage:
// <Script dangerouslySetInnerHTML={{ __html: scriptToBeLoaded }} async />
<></>
Comment on lines +157 to +160
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Remaining AdRoll References Detected

The AdRoll-related code has not been fully removed. Please address the following instances to ensure complete elimination:

  • runtime.config.js

    • adRollAdvId: process.env.ADROLL_ADV_ID,
    • adRollPixId: process.env.ADROLL_PIX_ID,
  • public/locales/en/common.json & public/locales/cn/common.json

    • Descriptions referencing AdRoll cookies.
  • features/content/cookie/en.tsx

    • Multiple <td>Adroll</td> entries.
    • Usage of __adroll_fpc.
  • analytics/manageCookie.ts

    • Comments related to AdRoll instance management.
  • README.md

    • References to ADROLL_PIX_ID and ADROLL_ADV_ID.
    • Descriptions mentioning AdRoll Pixel.
  • Dockerfile.production

    • Environment variables for ADROLL_ADV_ID and ADROLL_PIX_ID.

Please ensure that all AdRoll-related configurations, comments, and documentation are thoroughly removed to maintain codebase integrity.

Analysis chain

Approve AdRoll removal and suggest minor improvement

The removal of the AdRoll script is correctly implemented, aligning with the PR objective. The comment provides clear guidance for future marketing script additions, which is helpful.

However, we can make a small improvement:

Consider removing the empty fragment on line 160 as it's unnecessary:

  {cookiesValue?.enabledCookies?.marketing && (
    // Use when there is a need to load extra script required for marketing
    // Example usage:
    // <Script dangerouslySetInnerHTML={{ __html: scriptToBeLoaded }} async />
-   <></>
  )}

This change addresses the static analysis hint and slightly improves code cleanliness.

Let's verify the complete removal of AdRoll-related code:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining AdRoll-related code

# Test 1: Search for 'adroll' or 'AdRoll' in all files
echo "Searching for 'adroll' or 'AdRoll' in all files:"
rg -i 'adroll'

# Test 2: Check for any remaining imports from 'analytics/adroll'
echo "Checking for imports from 'analytics/adroll':"
rg "from 'analytics/adroll'"

# Test 3: Check if the 'analytics/adroll.ts' file still exists
echo "Checking if 'analytics/adroll.ts' file exists:"
fd 'adroll.ts' analytics

Length of output: 1606

Tools
Biome

[error] 160-160: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.

(lint/complexity/noUselessFragments)

)}
<ThemeUIProvider theme={theme}>
<CacheProvider value={cache}>
Expand Down
2 changes: 1 addition & 1 deletion public/locales/cn/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"cookies": {
"marketing": {
"title": "行销 Cookies",
"description": "Summer.fi 使用来自 adRoll 的匿名 Cookies 在广告平台上重新定位营销策略。"
"description": "Summer.fi 使用匿名 Cookies 在广告平台上重新定位营销策略。"
},
"analytics": {
"title": "分析 Cookies",
Expand Down
2 changes: 1 addition & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@
"cookies": {
"marketing": {
"title": "Marketing Cookies",
"description": "Summer.fi uses anonymised cookies from adRoll to be able to apply retargeting campaigns on advertising platforms."
"description": "Summer.fi uses anonymised cookies to be able to apply retargeting campaigns on advertising platforms."
},
"analytics": {
"title": "Analytics Cookies",
Expand Down
2 changes: 0 additions & 2 deletions runtime.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const publicRuntimeConfig = {
buildDate: Date.now(),
mixpanelEnv: process.env.MIXPANEL_ENV,
mixpanelAPIKey: process.env.MIXPANEL_KEY,
adRollAdvId: process.env.ADROLL_ADV_ID,
adRollPixId: process.env.ADROLL_PIX_ID,
useTermsOfService: process.env.USE_TERMS_OF_SERVICE === '1',
useTrmApi: process.env.USE_TRM_API === '1',
showBuildInfo: process.env.SHOW_BUILD_INFO === '1',
Expand Down
Loading