wfansh 6 tháng trước cách đây
mục cha
commit
da99191612

+ 3 - 0
src/main/java/com/wechi/adweb/bridge/DataBridgeApplication.java

@@ -3,6 +3,9 @@ package com.wechi.adweb.bridge;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+/**
+ * @author wfansh
+ */
 @SpringBootApplication
 public class DataBridgeApplication {
 

+ 4 - 3
src/main/java/com/wechi/adweb/bridge/google/gtm/GTMService.java

@@ -25,7 +25,7 @@ public class GTMService {
     private TagManager tagManager;
 
     @PostConstruct
-    private TagManager init() throws GeneralSecurityException, IOException {
+    public void init() throws GeneralSecurityException, IOException {
         // Service account authorization;
         HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
         GoogleCredential credential =
@@ -35,7 +35,8 @@ public class GTMService {
                                         .getResourceAsStream("google/service-account-key.json"))
                         .createScoped(TagManagerScopes.all());
 
-        return new TagManager.Builder(httpTransport, GsonFactory.getDefaultInstance(), credential)
-                .build();
+        this.tagManager =
+                new TagManager.Builder(httpTransport, GsonFactory.getDefaultInstance(), credential)
+                        .build();
     }
 }