Sarah CHEN -TAIWAN-
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Handover : Member Tag ###### `Data Team` ## To Do List - [ ] Member Tag - [x] Tool - [x] API - [x] Bigquery - [x] DataStudio - [x] Upload to IDeliver - [x] Upload to DataStudio - [x] [Tag Logic](https://hackmd.io/NGcmcXDBSEyi0vWkaLCHPQ) - [x] API - [x] Structure : Control - [x] CloudFunction - [x] All Functions - [x] Member Tag Tool - [x] Structure - [x] IDeliver - [x] DataStudio - [ ] Link - [x] [GitHub]( https://github.com/dktunited/taiwan_member_tag ) - [ ] Tutor Document - [ ] [English Version](https://docs.google.com/presentation/d/1yyHTDjQmlkT435md84IrocStZkaa3fio2n-Xy0nFORc/edit?usp=sharing) - [ ] [Chinese Version](https://docs.google.com/presentation/d/1wlAukzeXpy3bdTZfDxggSjjqGe-6Wi0AKXiflBowW9A/edit?usp=sharing) - [ ] [User Case](https://docs.google.com/presentation/d/1PdsFY4D7oNxS3c8TigkAxZJGiFgbRoa4bGdqhVZjIpI/edit#slide=id.p) - [ ] [Tag's Logic and Structure](https://docs.google.com/presentation/d/1sSvEelCYhSnhms3nGA6qDPPMZgXPB0n_SI9stt8og2A/edit?usp=sharing) - [ ] Miro : Member Tag Structure https://miro.com/app/board/uXjVPXj34-w=/ ---- ### Member Tag : Audience Generating Tool. Through consumption records/ member edit information/ external information,Get specific and verifiable information, that can be used to determine the profile of the member. ##### Project Location : https://github.com/dktunited/taiwan_member_tag ###### `Bigquery` `S3` `DataStudio` `Node.js` `Google Drive` `GitHub` `Cloud Functions` `IDeliver` `Line` Generating Tool : Node.js v16.13.0 Frame Work : Vue 2.6.14 * Page Description * TagView.vue : This is the main page for member tag. * main.js : Build All of This Frontend of Tool and Plugin Vue and Other Needed Packages * App.vue : Entrance File, This is set up to have two completely different website layouts, depending on if you are logged in or not ,so that is what ExternalView and DashboardView are for. LoginView renders in Externalview. API : Node.js v16.13.0 Frame Work : Node MVC * Function Description * audienceController : Get All of Audiences List ( Data Studio and Upload to IDeliver) * basicController : Integrating All of Member Informatoin * guidelineController * ideliverAudienceUpload * lineAudienceUpload * memberController : Get and Update Member Information From MongoDB * memberSportController * sportController : Get Global Sport List and Group them by Every Single Member * tagController * typeController : Get Global Transaction and relative with member Information finally put in MongoDB * Not Used List (Mongo and Cloud Run Eliminate) * the whole of "models" folder * router.js : it can't be used in google drive ### DataBase & Other Platform * Bigquery * member_tags * audiences : All Audience's Basic Information * data_studio_analysis_audience : Audience's All Transaction * data_studio_analysis_audience_event : Audience's All Activity They Do * data_studio_analysis_audience_list : Audience Name Correspond to Members * data_studio_analysis_audience_tag : Audience's All Tag * ec_product_list : EC's Product Lis (Not Used) * favor_sport_raw : Member's Favor Sport * type_id_raw : Member's Family Type * tags : All of Member's Tag (loyalty_card_num Correspond to Tag) * tag : Seperating Tag to "tag" and "value" (For Range Search and Show in DashBoard) * S3 * Decathlon_Taiwan/data_extraction/audience/:AudienceName : The member's Loyalty_card_num in this Audience that Want to Upload to IDeliver * Decathlon_Taiwan/data_extraction/tw_model_gender000 : Model Correspond to Gender * * DataStudio * Channel 9 : Member Tag Search By Enter loyalty_card_num * Channel 9-1 : Audience Search and Generate (Link to Member Tags Tool Page) * Channel 9-2 : Audience Analysis - Product & Transaction By Enter loyalty_card_num * Channel 9-3 : Profile and other By Enter loyalty_card_num * Channel 9-4 : Audience Analysis - Product & Transaction By Pre-upload ### Tutorial : Basic Tutorial For Run Member Tag Project * Step 1 : Build Environment * Install [Visual Studio Code](https://code.visualstudio.com/) / [Node.js v16.13.0](https://nodejs.org/download/release/v16.13.0/node-v16.13.0-x64.msi) * Download All Project From [GitHub](https://github.com/dktunited/taiwan_member_tag/tree/audience) : Code => Download ZIP * Or "git clone https://github.com/dktunited/taiwan_member_tag.git" => better for updating version * Using Visual Stuio Code to Open This Project Folder * Add Extended Module(Ctrl+Shift+X) install "npm" and "vue language fearutres" * Step 2 : (Test Enviroment API)Give Permision to Use Bigquery or Other Google Service * Enter "$env:GOOGLE_APPLICATION_CREDENTIALS='C:\Absolute Path\app-cloud-api.json'" : Give the Absolute Path of This Project * Step 3 : Start Run This Project's Developing Enviroment : * Open Terminal * Located to The Member Tag Folder "cd memberTagDev" or "cd api" (Go to api folder or memberTagDev folder, Depending on whick tool you want to use) * Install All Packages This Project Need "npm install" * Tool Running : Enter "npm run serve" or "node server.js" (run api or memberTagDev , Depending on whick tool you want to use) * Step 4 : (Member Tag Frontend Tool)Update to Formal environment * Stop Developing : Ctrl + C * Packaging Fianl Result : "npm run build" => it will generate "dist" folder under memberTagDev Folder * Change Path to Fit Google Drive : Open /dist/index.html => Ctrl + H=> search ""/" replace by ""./" => Ctrl + Alt + Enter * Upload to Google Drive : Upload All the things within dist * Step 5 : Test & Check * Open https://dseq6ztlhjjgxrhfkgyolg.on.drv.tw/audience.com/ with Shift to clear cache ### Basic Command * Git : * "git status" Checking The Change between Current Version and Previous Version * "git add ." Add All Current Files to The Upload List * "git commit -m 'reason for update'" Add Description for this Update * "git push" Upload All Files to The main branch * NPM : * "npm -v" Checking Version * "npm init" Initializing and Create Package.json File * "npm install" Follow Package.json to Install All of The Plugin (Packages) we need * "npm run serve" Build a Test Enviroment * "npm build" Package All The File to One File for Formal Enviroment * Basic Shell : * "cd ./direction" Move to Certain Folder * "ls" List All Files in This Folder * "cat ./file.txt" Show This File's Content * Node : * "node app.js" Run Certain JS File * "node -v" Check Node.js Version ## Other Information ### Resources [Drive to Web](https://www.drv.tw/) 將Google Drive與OneDrive內的html文件轉乘網站 [Vuetify](https://vuetifyjs.com/en/) Vue Plugin 可用設計零件 ### Test / Formal Environment Search "Test Environment" or "Formal Environment" Cross out the next line that you don't need Remove # mark the next line that you need EX: ``` // Formal Environment .get('https://us-central1-twdatawarehouse-bsv8.cloudfunctions.net/all-tag-detail') // Test Environment // .get('http://127.0.0.1:3000/tag/all') ``` ### Upload To IDeliver #### Structure : ![](https://i.imgur.com/F57yYmV.png) #### All Link : * Jenkins : https://jenkinsfordiscovery.subsidia.org/job/taiwan/job/taiwan_auto_update/ * GitHub : (Audience Branch) https://github.com/dktunited/taiwan_data_retail_extraction/tree/audience * Bigquery : twdatawarehouse-bsv8.member_tags.audiences => Show Audience List (Today) * Cloud Function : * Audience List : https://console.cloud.google.com/functions/details/us-central1/audience-list * Upload Audience To S3 : https://console.cloud.google.com/functions/details/us-central1/audiences2 * S3 : preprod.datamining/Decathlon_Taiwan/data_extraction/audience * RedShift : * Score Document https://docs.google.com/document/d/1ZHTRF7qwVLA5QrieL6cGmeqsjQBJiIxsPRMap50YP3I/edit * Table : * cds.d_seg_header * cds.f_seg_customer_segmentation * dtm_tw.tw_audience_tmp ### Upload To Bigquery (DataStudio) Copying loyalty_card_num to Analyze Audience, it only allow 200,000. Uploading to bigquery, it could over 3,000,000 #### Structure ![](https://i.imgur.com/egbv5nx.png) #### All Link : * Bigquery * data_studio_analysis_audience : Audience's All Transaction * data_studio_analysis_audience_event : Audience's All Activity They Do * data_studio_analysis_audience_list : Audience Name Correspond to Members * data_studio_analysis_audience_tag : Audience's All Tag * Bigquery Scheduled Queries : update_mins_audience_detail * Cloud Function * https://console.cloud.google.com/functions/details/us-central1/audiences2 * OnDemand.js File : Call Scheduled Queries's Function ---- ### Favor Sport Build Step Cloud Run's Job to Get The member Who Shopped Yesterday Weight, EventSite, Transaction to Calculate the Favor Sport Cloud Run's Code in https://github.com/dktunited/taiwan_member_tag/ #### Upload new image to Container Registry gcloud build submit --tag gcr.io/twdatawarehouse-bsv8/tag-favor-sport #### Build Cloud Run's Job gcloud beta run jobs create favorSport --image=gcr.io/twdatawarehouse-bsv8/sport --service-account=app-cloudrun-api@twdatawarehouse-bsv8.iam.gserviceaccount.com #### List All of Cloud Run's Job gcloud beta run jobs list #### Excute Cloud Run's gcloud beta run jobs execute $jobName

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully